From 9146d0e89c051ea7accf185d97317306c2532c27 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 29 Jun 2009 23:28:55 +0000 Subject: [PATCH] Add SMLoc::isValid method. - To support using SMLoc as a sentinel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74474 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/SourceMgr.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/llvm/Support/SourceMgr.h b/include/llvm/Support/SourceMgr.h index 25775cb7441..4170c8d6dc6 100644 --- a/include/llvm/Support/SourceMgr.h +++ b/include/llvm/Support/SourceMgr.h @@ -30,6 +30,8 @@ public: SMLoc() : Ptr(0) {} SMLoc(const SMLoc &RHS) : Ptr(RHS.Ptr) {} + bool isValid() const { return Ptr != 0; } + bool operator==(const SMLoc &RHS) const { return RHS.Ptr == Ptr; } bool operator!=(const SMLoc &RHS) const { return RHS.Ptr != Ptr; }