]> granicus.if.org Git - clang/commitdiff
Fix another case where we should be using isBeforeInTranslationUnit().
authorTed Kremenek <kremenek@apple.com>
Mon, 10 Sep 2012 19:07:56 +0000 (19:07 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 10 Sep 2012 19:07:56 +0000 (19:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163533 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/PathDiagnostic.cpp

index f51e16c0849f4021eda2201d03d778c07249b375..98a343b79d7c3c4c6f767fec94b80456367cc15b 100644 (file)
@@ -325,8 +325,10 @@ static bool compare(const PathDiagnostic &X, const PathDiagnostic &Y) {
       return false;
     SourceLocation XDL = XD->getLocation();
     SourceLocation YDL = YD->getLocation();
-    if (XDL != YDL)
-      return XDL < YDL;
+    if (XDL != YDL) {
+      const SourceManager &SM = XL.getManager();
+      return SM.isBeforeInTranslationUnit(XDL, YDL);
+    }
   }
   PathDiagnostic::meta_iterator XI = X.meta_begin(), XE = X.meta_end();
   PathDiagnostic::meta_iterator YI = Y.meta_begin(), YE = Y.meta_end();