]> granicus.if.org Git - clang/commitdiff
Use isBeforeInTranslationUnitThan() instead of operator<.
authorTed Kremenek <kremenek@apple.com>
Mon, 10 Sep 2012 06:56:07 +0000 (06:56 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 10 Sep 2012 06:56:07 +0000 (06:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163490 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/PathDiagnostic.cpp

index eb9e10c420a755ba0f1a2a7f025d31ab6b31071f..48d05a0c918050b9bcca5ae9e99cf67f05ab26db 100644 (file)
@@ -215,11 +215,11 @@ compareControlFlow(const PathDiagnosticControlFlowPiece &X,
   FullSourceLoc XSL = X.getStartLocation().asLocation();
   FullSourceLoc YSL = Y.getStartLocation().asLocation();
   if (XSL != YSL)
-    return XSL < YSL;
+    return XSL.isBeforeInTranslationUnitThan(YSL);
   FullSourceLoc XEL = X.getStartLocation().asLocation();
   FullSourceLoc YEL = Y.getStartLocation().asLocation();
   if (XEL != YEL)
-    return XEL < YEL;
+    return XEL.isBeforeInTranslationUnitThan(YEL);
   return llvm::Optional<bool>();
 }
 
@@ -235,15 +235,15 @@ compareCall(const PathDiagnosticCallPiece &X,
   FullSourceLoc X_CEL = X.callEnter.asLocation();
   FullSourceLoc Y_CEL = Y.callEnter.asLocation();
   if (X_CEL != Y_CEL)
-    return X_CEL < Y_CEL;
+    return X_CEL.isBeforeInTranslationUnitThan(Y_CEL);
   FullSourceLoc X_CEWL = X.callEnterWithin.asLocation();
   FullSourceLoc Y_CEWL = Y.callEnterWithin.asLocation();
   if (X_CEWL != Y_CEWL)
-    return X_CEWL < Y_CEWL;
+    return X_CEWL.isBeforeInTranslationUnitThan(Y_CEWL);
   FullSourceLoc X_CRL = X.callReturn.asLocation();
   FullSourceLoc Y_CRL = Y.callReturn.asLocation();
   if (X_CRL != Y_CRL)
-    return X_CRL < Y_CRL;
+    return X_CRL.isBeforeInTranslationUnitThan(Y_CRL);
   return comparePath(X.path, Y.path);
 }
 
@@ -255,7 +255,7 @@ static llvm::Optional<bool> comparePiece(const PathDiagnosticPiece &X,
   FullSourceLoc XL = X.getLocation().asLocation();
   FullSourceLoc YL = Y.getLocation().asLocation();
   if (XL != YL)
-    return XL < YL;
+    return XL.isBeforeInTranslationUnitThan(YL);
 
   if (X.getString() != Y.getString())
     return X.getString() < Y.getString();
@@ -305,7 +305,7 @@ static bool compare(const PathDiagnostic &X, const PathDiagnostic &Y) {
   FullSourceLoc XL = X.getLocation().asLocation();
   FullSourceLoc YL = Y.getLocation().asLocation();
   if (XL != YL)
-    return XL < YL;
+    return XL.isBeforeInTranslationUnitThan(YL);
   if (X.getBugType() != Y.getBugType())
     return X.getBugType() < Y.getBugType();
   if (X.getCategory() != Y.getCategory())