[cfe-commits] r67946 - /cfe/trunk/include/clang/Basic/SourceLocation.h

Ted Kremenek kremenek at apple.com
Sat Mar 28 10:32:42 PDT 2009


Author: kremenek
Date: Sat Mar 28 12:32:39 2009
New Revision: 67946

URL: http://llvm.org/viewvc/llvm-project?rev=67946&view=rev
Log:
Add comparison operators for SourceRange.

Modified:
    cfe/trunk/include/clang/Basic/SourceLocation.h

Modified: cfe/trunk/include/clang/Basic/SourceLocation.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceLocation.h?rev=67946&r1=67945&r2=67946&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/SourceLocation.h (original)
+++ cfe/trunk/include/clang/Basic/SourceLocation.h Sat Mar 28 12:32:39 2009
@@ -169,6 +169,14 @@
   
   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;    
 





More information about the cfe-commits mailing list