summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/Environment.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-09-22 18:10:41 +0000
committerAnna Zaks <ganna@apple.com>2011-09-22 18:10:41 +0000
commit9db35a87508147007ea1d3aa1a7b3d56ed65138e (patch)
treecc3064f08d1e91486ac131eea0daa2b32f0b8339 /clang/lib/StaticAnalyzer/Core/Environment.cpp
parentf04ee930a039e5710ca44997f14ddfb96a0ba7e0 (diff)
downloadbcm5719-llvm-9db35a87508147007ea1d3aa1a7b3d56ed65138e.tar.gz
bcm5719-llvm-9db35a87508147007ea1d3aa1a7b3d56ed65138e.zip
ST->scanReachableSymbols() is creating a SubRegionMap (SRM) on every call since one SRM is created in each ScanReachableSymbols instance. Creating the object just once and calling only scan inside the loop gives ~ 14% speed up of the StaticAnalyzer run (Release+Asserts).
Pull out the declaration of the ScanReachableSymbols so that it can be used directly. Document ProgramState::scanReachableSymbols() methods. llvm-svn: 140323
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/Environment.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/Environment.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/Environment.cpp b/clang/lib/StaticAnalyzer/Core/Environment.cpp
index 2d37e53ceee..0ca11686315 100644
--- a/clang/lib/StaticAnalyzer/Core/Environment.cpp
+++ b/clang/lib/StaticAnalyzer/Core/Environment.cpp
@@ -156,6 +156,9 @@ EnvironmentManager::removeDeadBindings(Environment Env,
SmallVector<std::pair<const Stmt*, SVal>, 10> deferredLocations;
+ MarkLiveCallback CB(SymReaper);
+ ScanReachableSymbols RSScaner(ST, CB);
+
// Iterate over the block-expr bindings.
for (Environment::iterator I = Env.begin(), E = Env.end();
I != E; ++I) {
@@ -183,8 +186,7 @@ EnvironmentManager::removeDeadBindings(Environment Env,
}
// Mark all symbols in the block expr's value live.
- MarkLiveCallback cb(SymReaper);
- ST->scanReachableSymbols(X, cb);
+ RSScaner.scan(X);
continue;
}
OpenPOWER on IntegriCloud