summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/BugReporter.cpp50
1 files changed, 0 insertions, 50 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
index f4aa9ef6f48..c63afc1411b 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -1566,45 +1566,6 @@ static void addEdgeToPath(PathPieces &path,
PrevLoc = NewLoc;
}
-enum EventCategorization { EC_None, EC_EnterLoop, EC_LoopingBack };
-
-typedef llvm::DenseMap<const PathDiagnosticEventPiece *,
- enum EventCategorization>
- EventCategoryMap;
-
-
-static void pruneLoopEvents(PathPieces &path, EventCategoryMap &ECM) {
- for (PathPieces::iterator I = path.begin(), E = path.end(); I != E; ++I) {
- if (PathDiagnosticCallPiece *call = dyn_cast<PathDiagnosticCallPiece>(*I)) {
- pruneLoopEvents(call->path, ECM);
- continue;
- }
-
- PathDiagnosticEventPiece *I_event = dyn_cast<PathDiagnosticEventPiece>(*I);
- if (!I_event || ECM[I_event] != EC_LoopingBack)
- continue;
-
- PathPieces::iterator Next = I; ++Next;
- PathDiagnosticEventPiece *Next_event = 0;
- for ( ; Next != E ; ++Next) {
- Next_event = dyn_cast<PathDiagnosticEventPiece>(*Next);
- if (Next_event)
- break;
- }
-
- if (Next_event) {
- EventCategorization E = ECM[Next_event];
- if (E == EC_EnterLoop) {
- PathDiagnosticLocation L = I_event->getLocation();
- PathDiagnosticLocation L_next = Next_event->getLocation();
- if (L == L_next) {
- path.erase(Next);
- }
- }
- }
- }
-}
-
static bool
GenerateAlternateExtensivePathDiagnostic(PathDiagnostic& PD,
PathDiagnosticBuilder &PDB,
@@ -1621,8 +1582,6 @@ GenerateAlternateExtensivePathDiagnostic(PathDiagnostic& PD,
llvm::DenseMap<const StackFrameContext *, PathDiagnosticLocation>
PrevLocMap;
- EventCategoryMap EventCategory;
-
const ExplodedNode *NextNode = N->getFirstPred();
while (NextNode) {
N = NextNode;
@@ -1731,7 +1690,6 @@ GenerateAlternateExtensivePathDiagnostic(PathDiagnostic& PD,
addEdgeToPath(PD.getActivePath(), PrevLoc, p->getLocation(), LC);
PD.getActivePath().push_front(p);
- EventCategory[p] = EC_LoopingBack;
}
const CFGBlock *BSrc = BE->getSrc();
@@ -1746,7 +1704,6 @@ GenerateAlternateExtensivePathDiagnostic(PathDiagnostic& PD,
isInLoopBody(PM, getStmtBeforeCond(PM, TermCond, N), Term);
const char *str = 0;
- enum EventCategorization EC = EC_None;
if (isJumpToFalseBranch(&*BE)) {
if (!IsInLoopBody) {
@@ -1755,14 +1712,12 @@ GenerateAlternateExtensivePathDiagnostic(PathDiagnostic& PD,
}
else {
str = "Entering loop body";
- EC = EC_EnterLoop;
}
if (str) {
PathDiagnosticLocation L(TermCond, SM, PDB.LC);
PathDiagnosticEventPiece *PE =
new PathDiagnosticEventPiece(L, str);
- EventCategory[PE] = EC;
PE->setPrunable(true);
addEdgeToPath(PD.getActivePath(), PrevLoc,
PE->getLocation(), LC);
@@ -1794,11 +1749,6 @@ GenerateAlternateExtensivePathDiagnostic(PathDiagnostic& PD,
}
}
- if (report->isValid()) {
- // Prune redundant loop diagnostics.
- pruneLoopEvents(PD.getMutablePieces(), EventCategory);
- }
-
return report->isValid();
}
OpenPOWER on IntegriCloud