]> granicus.if.org Git - clang/commitdiff
IdempotentOperationChecker no longer reports errors that are post-dominated by a...
authorTom Care <tom.care@uqconnect.edu.au>
Sat, 18 Sep 2010 00:06:34 +0000 (00:06 +0000)
committerTom Care <tom.care@uqconnect.edu.au>
Sat, 18 Sep 2010 00:06:34 +0000 (00:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114244 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/IdempotentOperationChecker.cpp

index 3dcbea491eb7b263011910f91f744d9a2142dccf..f392a8da82df210988f3376c55b64fbd4a2b87aa 100644 (file)
@@ -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) {