diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-04-14 21:14:03 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-04-14 21:14:03 +0000 |
commit | 13ad6e1234447c6ccaaecef590ed530f0b291c2d (patch) | |
tree | 6beffec37af38b543aabf27afda8eb598bf88a44 /clang/Driver/HTMLPrint.cpp | |
parent | bb2b224159831145e51721c13a16341b85401ca0 (diff) | |
download | bcm5719-llvm-13ad6e1234447c6ccaaecef590ed530f0b291c2d.tar.gz bcm5719-llvm-13ad6e1234447c6ccaaecef590ed530f0b291c2d.zip |
Convert over to new SourceManager::isFromMainFile() instead of doing direct
FileID comparison (fixes insidious corner case with chunks).
llvm-svn: 49684
Diffstat (limited to 'clang/Driver/HTMLPrint.cpp')
-rw-r--r-- | clang/Driver/HTMLPrint.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/clang/Driver/HTMLPrint.cpp b/clang/Driver/HTMLPrint.cpp index ef20395530c..77e85d71e09 100644 --- a/clang/Driver/HTMLPrint.cpp +++ b/clang/Driver/HTMLPrint.cpp @@ -157,16 +157,13 @@ void HTMLDiagnostic::HandleDiagnostic(Diagnostic &Diags, SourceManager& SM = R.getSourceMgr(); FullSourceLoc LPos = Pos.getLogicalLoc(); - unsigned FileID = LPos.getLocation().getFileID(); + unsigned FileID = SM.getCanonicalFileID(LPos.getLocation()); assert (&LPos.getManager() == &SM && "SourceManagers are different!"); - unsigned MainFileID = SM.getMainFileID(); - - if (FileID != MainFileID) + if (!SM.isFromMainFile(LPos.getLocation())) return; - // Compute the column number. Rewind from the current position to the start // of the line. @@ -228,13 +225,12 @@ void HTMLDiagnostic::HandleDiagnostic(Diagnostic &Diags, ++Ranges; - if (B.getFileID() != MainFileID || E.getFileID() != MainFileID) + if (!SM.isFromMainFile(B) || !SM.isFromMainFile(E)) continue; // Highlight the range. Make the span tag the outermost tag for the // selected range. R.InsertCStrBefore(B, "<span class=\"mrange\">"); R.InsertCStrAfter(E, "</span>"); - } - + } } |