summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-03-28 17:32:39 +0000
committerTed Kremenek <kremenek@apple.com>2009-03-28 17:32:39 +0000
commit04ab6c8b172fa75b97177ea12b93bfb427f0fcba (patch)
tree61f0459b19f746d4bf4e34b514718b4dbe19f23e
parentc2a17d30221ec873c360aedb967e1ed6c07e951d (diff)
downloadbcm5719-llvm-04ab6c8b172fa75b97177ea12b93bfb427f0fcba.tar.gz
bcm5719-llvm-04ab6c8b172fa75b97177ea12b93bfb427f0fcba.zip
Add comparison operators for SourceRange.
llvm-svn: 67946
-rw-r--r--clang/include/clang/Basic/SourceLocation.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/include/clang/Basic/SourceLocation.h b/clang/include/clang/Basic/SourceLocation.h
index ba0bb6faac5..3ed26fcbb2a 100644
--- a/clang/include/clang/Basic/SourceLocation.h
+++ b/clang/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;
OpenPOWER on IntegriCloud