[cfe-commits] r114244 - /cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp

Tom Care tcare at apple.com
Fri Sep 17 17:06:34 PDT 2010


Author: tcare
Date: Fri Sep 17 19:06:34 2010
New Revision: 114244

URL: http://llvm.org/viewvc/llvm-project?rev=114244&view=rev
Log:
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).

Modified:
    cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp

Modified: cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp?rev=114244&r1=114243&r2=114244&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp (original)
+++ cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp Fri Sep 17 19:06:34 2010
@@ -364,6 +364,9 @@
                                                   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) {





More information about the cfe-commits mailing list