]> granicus.if.org Git - clang/commitdiff
Add operator '<=' for comparing SourceLocations.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 20 Jun 2009 08:08:38 +0000 (08:08 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 20 Jun 2009 08:08:38 +0000 (08:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73820 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/SourceLocation.h

index 2405c2fe7db72b61f7ef4f8e4fbdc4941281e379..7d78087d9db567bdd22d64126ee3795ab9e56f3d 100644 (file)
@@ -145,6 +145,10 @@ inline bool operator<(const SourceLocation &LHS, const SourceLocation &RHS) {
   return LHS.getRawEncoding() < RHS.getRawEncoding();
 }
 
+inline bool operator<=(const SourceLocation &LHS, const SourceLocation &RHS) {
+  return LHS.getRawEncoding() <= RHS.getRawEncoding();
+}
+
 /// SourceRange - a trival tuple used to represent a source range.
 class SourceRange {
   SourceLocation B;