From: Ted Kremenek Date: Sun, 2 Nov 2008 00:33:58 +0000 (+0000) Subject: Fixed a horrible bug in HTMLDiagnostics.cpp where bugs referencing source ranges... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=583e898efa890be581606f8162caac126d4a7106;p=clang Fixed a horrible bug in HTMLDiagnostics.cpp where bugs referencing source ranges that occur within macros would not be emitted at all. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58550 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/HTMLDiagnostics.cpp b/lib/Driver/HTMLDiagnostics.cpp index 9bd62815e8..72870fefe0 100644 --- a/lib/Driver/HTMLDiagnostics.cpp +++ b/lib/Driver/HTMLDiagnostics.cpp @@ -132,7 +132,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) { // Verify that the entire path is from the same FileID. for (PathDiagnostic::const_iterator I=D.begin(), E=D.end(); I != E; ++I) { - FullSourceLoc L = I->getLocation(); + FullSourceLoc L = I->getLocation().getLogicalLoc(); if (!L.isFileID()) return; // FIXME: Emit a warning? @@ -148,7 +148,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) { for (PathDiagnosticPiece::range_iterator RI=I->ranges_begin(), RE=I->ranges_end(); RI!=RE; ++RI) { - SourceLocation L = RI->getBegin(); + SourceLocation L = SMgr.getLogicalLoc(RI->getBegin()); if (!L.isFileID()) return; // FIXME: Emit a warning? @@ -156,7 +156,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) { if (SMgr.getCanonicalFileID(L) != FileID) return; // FIXME: Emit a warning? - L = RI->getEnd(); + L = SMgr.getLogicalLoc(RI->getEnd()); if (!L.isFileID()) return; // FIXME: Emit a warning?