aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/BugReporter.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2013-04-29 23:12:59 +0000
committerTed Kremenek <kremenek@apple.com>2013-04-29 23:12:59 +0000
commited866e73bab7733f5226f84c52edefe23d694b2f (patch)
tree1fd6e17ad86eadf1cda4d272c692d249291d8865 /lib/StaticAnalyzer/Core/BugReporter.cpp
parent7651e53997e20f1e627ffce25ce613f79c48e3e3 (diff)
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
Diffstat (limited to 'lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/BugReporter.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp
index 930f4bc99a..52c364e891 100644
--- a/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -123,7 +123,7 @@ static void removeRedundantMsgs(PathPieces &path) {
break;
if (PathDiagnosticEventPiece *nextEvent =
- dyn_cast<PathDiagnosticEventPiece>(path.front())) {
+ dyn_cast<PathDiagnosticEventPiece>(path.front().getPtr())) {
PathDiagnosticEventPiece *event =
cast<PathDiagnosticEventPiece>(piece);
// Check to see if we should keep one of the two pieces. If we
@@ -210,10 +210,10 @@ bool BugReporter::RemoveUnneededCalls(PathPieces &pieces, BugReport *R) {
static void adjustCallLocations(PathPieces &Pieces,
PathDiagnosticLocation *LastCallLocation = 0) {
for (PathPieces::iterator I = Pieces.begin(), E = Pieces.end(); I != E; ++I) {
- PathDiagnosticCallPiece *Call = dyn_cast<PathDiagnosticCallPiece>(&*I);
+ PathDiagnosticCallPiece *Call = dyn_cast<PathDiagnosticCallPiece>(*I);
if (!Call) {
- assert(I->getLocation().asLocation().isValid());
+ assert((*I)->getLocation().asLocation().isValid());
continue;
}
@@ -946,7 +946,7 @@ public:
// If the PathDiagnostic already has pieces, add the enclosing statement
// of the first piece as a context as well.
if (!PD.path.empty()) {
- PrevLoc = PD.path.begin()->getLocation();
+ PrevLoc = (*PD.path.begin())->getLocation();
if (const Stmt *S = PrevLoc.asStmt())
addExtendedContext(PDB.getEnclosingStmtLocation(S).asStmt());
@@ -1987,10 +1987,10 @@ static void CompactPathDiagnostic(PathPieces &path, const SourceManager& SM) {
MacroStackTy MacroStack;
PiecesTy Pieces;
- for (PathPieces::iterator I = path.begin(), E = path.end();
+ for (PathPieces::const_iterator I = path.begin(), E = path.end();
I!=E; ++I) {
- PathDiagnosticPiece *piece = &*I;
+ PathDiagnosticPiece *piece = I->getPtr();
// Recursively compact calls.
if (PathDiagnosticCallPiece *call=dyn_cast<PathDiagnosticCallPiece>(piece)){