diff options
Diffstat (limited to 'lib/StaticAnalyzer/Core/BugReporterVisitors.cpp')
| -rw-r--r-- | lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index c6fd63f3bd..baef8cc9c0 100644 --- a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -238,23 +238,11 @@ PathDiagnosticPiece *FindLastStoreBRVisitor::VisitNode(const ExplodedNode *N, return NULL; } - // FIXME: Refactor this into BugReporterContext. - const Stmt *S = 0; + // Construct a new PathDiagnosticPiece. ProgramPoint P = N->getLocation(); - - if (BlockEdge *BE = dyn_cast<BlockEdge>(&P)) { - const CFGBlock *BSrc = BE->getSrc(); - S = BSrc->getTerminatorCondition(); - } - else if (PostStmt *PS = dyn_cast<PostStmt>(&P)) { - S = PS->getStmt(); - } - - if (!S) + PathDiagnosticLocation L = PathDiagnosticLocation(P,BRC.getSourceManager()); + if (!L.isValid()) return NULL; - - // Construct a new PathDiagnosticPiece. - PathDiagnosticLocation L(S, BRC.getSourceManager(), P.getLocationContext()); return new PathDiagnosticEventPiece(L, os.str()); } @@ -298,23 +286,11 @@ TrackConstraintBRVisitor::VisitNode(const ExplodedNode *N, if (os.str().empty()) return NULL; - // FIXME: Refactor this into BugReporterContext. - const Stmt *S = 0; + // Construct a new PathDiagnosticPiece. ProgramPoint P = N->getLocation(); - - if (BlockEdge *BE = dyn_cast<BlockEdge>(&P)) { - const CFGBlock *BSrc = BE->getSrc(); - S = BSrc->getTerminatorCondition(); - } - else if (PostStmt *PS = dyn_cast<PostStmt>(&P)) { - S = PS->getStmt(); - } - - if (!S) + PathDiagnosticLocation L = PathDiagnosticLocation(P,BRC.getSourceManager()); + if (!L.isValid()) return NULL; - - // Construct a new PathDiagnosticPiece. - PathDiagnosticLocation L(S, BRC.getSourceManager(), P.getLocationContext()); return new PathDiagnosticEventPiece(L, os.str()); } |
