diff options
author | Anna Zaks <ganna@apple.com> | 2011-09-22 18:10:41 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2011-09-22 18:10:41 +0000 |
commit | 5f625712f622f6e57de17b6f7eec242956b993ee (patch) | |
tree | 27472f5b34834e40e70bb4b1899c162209de1636 /lib/StaticAnalyzer/Core/Environment.cpp | |
parent | d8e0fe617af3c9fb60a680ecb2ff765b71ef3c1d (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140323 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/Environment.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/Environment.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/StaticAnalyzer/Core/Environment.cpp b/lib/StaticAnalyzer/Core/Environment.cpp index 2d37e53cee..0ca1168631 100644 --- a/lib/StaticAnalyzer/Core/Environment.cpp +++ b/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; } |