summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-09-10 19:02:33 +0000
committerTed Kremenek <kremenek@apple.com>2012-09-10 19:02:33 +0000
commit54fd07926531a094826b3422277e69005658acbf (patch)
tree735e683198e6da9fae26193159656c0d5a10729a /clang/lib
parent3c86b78ae4d03a31ae4f38dc70659c408d324880 (diff)
downloadbcm5719-llvm-54fd07926531a094826b3422277e69005658acbf.tar.gz
bcm5719-llvm-54fd07926531a094826b3422277e69005658acbf.zip
Add a few more cases where we should be using isBeforeInTranslationUnit().
llvm-svn: 163531
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
index 73694a69949..f51e16c0849 100644
--- a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
+++ b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
@@ -263,13 +263,15 @@ static llvm::Optional<bool> comparePiece(const PathDiagnosticPiece &X,
if (X.getRanges().size() != Y.getRanges().size())
return X.getRanges().size() < Y.getRanges().size();
+ const SourceManager &SM = XL.getManager();
+
for (unsigned i = 0, n = X.getRanges().size(); i < n; ++i) {
SourceRange XR = X.getRanges()[i];
SourceRange YR = Y.getRanges()[i];
if (XR != YR) {
if (XR.getBegin() != YR.getBegin())
- return XR.getBegin() < YR.getBegin();
- return XR.getEnd() < YR.getEnd();
+ return SM.isBeforeInTranslationUnit(XR.getBegin(), YR.getBegin());
+ return SM.isBeforeInTranslationUnit(XR.getEnd(), YR.getEnd());
}
}
OpenPOWER on IntegriCloud