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 | 2acdff09235b71d3aeccff83fa04ea1d8de27b1b (patch) | |
tree | bcced127de85e6ee5634ab67e3f9eeea0241b299 /include/llvm/Support/SourceMgr.h | |
parent | d0b4295c8d764168a7ff85e631068ceb4ad0fb69 (diff) | |
download | external_llvm-2acdff09235b71d3aeccff83fa04ea1d8de27b1b.zip external_llvm-2acdff09235b71d3aeccff83fa04ea1d8de27b1b.tar.gz external_llvm-2acdff09235b71d3aeccff83fa04ea1d8de27b1b.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/llvm/Support/SourceMgr.h')
-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; } |