diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-06-29 23:28:55 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-06-29 23:28:55 +0000 |
commit | 9146d0e89c051ea7accf185d97317306c2532c27 (patch) | |
tree | bcced127de85e6ee5634ab67e3f9eeea0241b299 /include | |
parent | 0faea04e8f4d6c7d26d087dff24773e3f35d1301 (diff) | |
download | external_llvm-9146d0e89c051ea7accf185d97317306c2532c27.zip external_llvm-9146d0e89c051ea7accf185d97317306c2532c27.tar.gz external_llvm-9146d0e89c051ea7accf185d97317306c2532c27.tar.bz2 |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/SourceMgr.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/Support/SourceMgr.h b/include/llvm/Support/SourceMgr.h index 25775cb..4170c8d 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; } |