From ed866e73bab7733f5226f84c52edefe23d694b2f Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 29 Apr 2013 23:12:59 +0000 Subject: Revert "[analyzer] Change PathPieces to be a wrapper around an ilist of (through indirection) PathDiagnosticPieces." Jordan rightly pointed out that we can do the same with std::list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180746 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp') diff --git a/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp b/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp index a5fe300fb6..73426da2b4 100644 --- a/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp +++ b/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp @@ -126,10 +126,10 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D, // The path as already been prechecked that all parts of the path are // from the same file and that it is non-empty. - const SourceManager &SMgr = path.begin()->getLocation().getManager(); + const SourceManager &SMgr = (*path.begin())->getLocation().getManager(); assert(!path.empty()); FileID FID = - path.begin()->getLocation().asLocation().getExpansionLoc().getFileID(); + (*path.begin())->getLocation().asLocation().getExpansionLoc().getFileID(); assert(!FID.isInvalid()); // Create a new rewriter to generate HTML. @@ -139,10 +139,10 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D, unsigned n = path.size(); unsigned max = n; - for (PathPieces::reverse_iterator I = path.rbegin(), + for (PathPieces::const_reverse_iterator I = path.rbegin(), E = path.rend(); I != E; ++I, --n) - HandlePiece(R, FID, *I, n, max); + HandlePiece(R, FID, **I, n, max); // Add line numbers, header, footer, etc. @@ -185,9 +185,9 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D, << html::EscapeText(Entry->getName()) << "\nLocation:" "line " - << path.rbegin()->getLocation().asLocation().getExpansionLineNumber() + << (*path.rbegin())->getLocation().asLocation().getExpansionLineNumber() << ", column " - << path.rbegin()->getLocation().asLocation().getExpansionColumnNumber() + << (*path.rbegin())->getLocation().asLocation().getExpansionColumnNumber() << "\n" "Description:" << D.getVerboseDescription() << "\n"; @@ -503,16 +503,16 @@ unsigned HTMLDiagnostics::ProcessMacroPiece(raw_ostream &os, const PathDiagnosticMacroPiece& P, unsigned num) { - for (PathPieces::iterator I = P.subPieces.begin(), E=P.subPieces.end(); + for (PathPieces::const_iterator I = P.subPieces.begin(), E=P.subPieces.end(); I!=E; ++I) { if (const PathDiagnosticMacroPiece *MP = - dyn_cast(&*I)) { + dyn_cast(*I)) { num = ProcessMacroPiece(os, *MP, num); continue; } - if (PathDiagnosticEventPiece *EP = dyn_cast(&*I)){ + if (PathDiagnosticEventPiece *EP = dyn_cast(*I)) { os << "
" "" -- cgit v1.2.3-70-g09d2