Fix another case where we should be using isBeforeInTranslationUnit().

llvm-svn: 163533
This commit is contained in:
Ted Kremenek 2012-09-10 19:07:56 +00:00
parent 7307fea911
commit a0fa5d6564
1 changed files with 4 additions and 2 deletions

View 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();