summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-02-15 02:20:03 +0000
committerTed Kremenek <kremenek@apple.com>2011-02-15 02:20:03 +0000
commit4ea9004fe8a555849f12f67600f4d5d09016d1db (patch)
tree44c508ce2b53cf7f47b9e9f3d5f56ff44398ce2a /clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
parent8d53ac81ecd85b43b7e2a29c48a8efe25869115e (diff)
downloadbcm5719-llvm-4ea9004fe8a555849f12f67600f4d5d09016d1db.tar.gz
bcm5719-llvm-4ea9004fe8a555849f12f67600f4d5d09016d1db.zip
IdempotentOperationChecker: don't repeatedly recompute block reachability.
llvm-svn: 125548
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
index 8f47f9eb4fe..2b0753649e3 100644
--- a/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
@@ -563,8 +563,9 @@ IdempotentOperationChecker::pathWasCompletelyAnalyzed(const CFG *cfg,
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;
OpenPOWER on IntegriCloud