forked from OSchip/llvm-project
IdempotentOperationChecker no longer reports errors that are post-dominated by a sink. This fixes some false positives that were flagged because a path was incomplete (usually in a loop).
llvm-svn: 114244
This commit is contained in:
parent
af5d63583e
commit
0f99e64305
|
@ -364,6 +364,9 @@ void IdempotentOperationChecker::VisitEndAnalysis(ExplodedGraph &G,
|
|||
BugReporter &BR,
|
||||
GRExprEngine &Eng) {
|
||||
BugType *BT = new BugType("Idempotent operation", "Dead code");
|
||||
// If a sink is present, we may have not seen the complete path.
|
||||
BT->setSuppressOnSink(true);
|
||||
|
||||
// Iterate over the hash to see if we have any paths with definite
|
||||
// idempotent operations.
|
||||
for (AssumptionMap::const_iterator i = hash.begin(); i != hash.end(); ++i) {
|
||||
|
|
Loading…
Reference in New Issue