diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-03-28 17:32:39 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-03-28 17:32:39 +0000 |
commit | a898283deb689b2454f3a966ef1cbf81bcb3e3e4 (patch) | |
tree | b9022212db94e40881c2cb558fbcf8598d71e9de /include/clang/Basic/SourceLocation.h | |
parent | ec6986a8a8ede664fa3762f77bd40a383a954a76 (diff) |
Add comparison operators for SourceRange.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceLocation.h')
-rw-r--r-- | include/clang/Basic/SourceLocation.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h index ba0bb6faac..3ed26fcbb2 100644 --- a/include/clang/Basic/SourceLocation.h +++ b/include/clang/Basic/SourceLocation.h @@ -169,6 +169,14 @@ public: bool isValid() const { return B.isValid() && E.isValid(); } + bool operator==(const SourceRange &X) const { + return B == X.B && E == X.E; + } + + bool operator!=(const SourceRange &X) const { + return B != X.B || E != X.E; + } + /// Emit - Emit this SourceRange object to Bitcode. void Emit(llvm::Serializer& S) const; |