[cfe-commits] r125548 - /cfe/trunk/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp

Ted Kremenek kremenek at apple.com
Mon Feb 14 18:20:03 PST 2011


Author: kremenek
Date: Mon Feb 14 20:20:03 2011
New Revision: 125548

URL: http://llvm.org/viewvc/llvm-project?rev=125548&view=rev
Log:
IdempotentOperationChecker: don't repeatedly recompute block reachability.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp?rev=125548&r1=125547&r2=125548&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp Mon Feb 14 20:20:03 2011
@@ -563,8 +563,9 @@
                                                       const CFGBlock *CB,
                                                       const CFGStmtMap *CBM,
                                                       const CoreEngine &CE) {
-  
-  CRA.reset(new CFGReachabilityAnalysis(*cfg));
+
+  if (!CRA.get())
+    CRA.reset(new CFGReachabilityAnalysis(*cfg));
   
   // Test for reachability from any aborted blocks to this block
   typedef CoreEngine::BlocksAborted::const_iterator AbortedIterator;





More information about the cfe-commits mailing list