From: Ted Kremenek Date: Sat, 28 Mar 2009 17:32:39 +0000 (+0000) Subject: Add comparison operators for SourceRange. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a898283deb689b2454f3a966ef1cbf81bcb3e3e4;p=clang Add comparison operators for SourceRange. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67946 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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;