[PATCH] D70150: [analyzer] Don't clean up dead symbols from constraints twice.
Artem Dergachev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 21 19:03:38 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rGbbc8662db154: [analyzer] NFC: Don't clean up range constraints twice. (authored by dergachev.a).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70150/new/
https://reviews.llvm.org/D70150
Files:
clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
clang/lib/StaticAnalyzer/Core/ProgramState.cpp
Index: clang/lib/StaticAnalyzer/Core/ProgramState.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Core/ProgramState.cpp
+++ clang/lib/StaticAnalyzer/Core/ProgramState.cpp
@@ -91,10 +91,9 @@
I->second.second(I->second.first);
}
-ProgramStateRef
-ProgramStateManager::removeDeadBindings(ProgramStateRef state,
- const StackFrameContext *LCtx,
- SymbolReaper& SymReaper) {
+ProgramStateRef ProgramStateManager::removeDeadBindingsFromEnvironmentAndStore(
+ ProgramStateRef state, const StackFrameContext *LCtx,
+ SymbolReaper &SymReaper) {
// This code essentially performs a "mark-and-sweep" of the VariableBindings.
// The roots are any Block-level exprs and Decls that our liveness algorithm
@@ -112,8 +111,7 @@
NewState.setStore(newStore);
SymReaper.setReapedStore(newStore);
- ProgramStateRef Result = getPersistentState(NewState);
- return ConstraintMgr->removeDeadBindings(Result, SymReaper);
+ return getPersistentState(NewState);
}
ProgramStateRef ProgramState::bindLoc(Loc LV,
Index: clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -728,7 +728,8 @@
// Create a state in which dead bindings are removed from the environment
// and the store. TODO: The function should just return new env and store,
// not a new state.
- CleanedState = StateMgr.removeDeadBindings(CleanedState, SFC, SymReaper);
+ CleanedState = StateMgr.removeDeadBindingsFromEnvironmentAndStore(
+ CleanedState, SFC, SymReaper);
// Process any special transfer function for dead symbols.
// A tag to track convenience transitions, which can be removed at cleanup.
Index: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
===================================================================
--- clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
+++ clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
@@ -533,9 +533,10 @@
ConstraintManager &getConstraintManager() { return *ConstraintMgr; }
SubEngine &getOwningEngine() { return *Eng; }
- ProgramStateRef removeDeadBindings(ProgramStateRef St,
- const StackFrameContext *LCtx,
- SymbolReaper& SymReaper);
+ ProgramStateRef
+ removeDeadBindingsFromEnvironmentAndStore(ProgramStateRef St,
+ const StackFrameContext *LCtx,
+ SymbolReaper &SymReaper);
public:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70150.230579.patch
Type: text/x-patch
Size: 2752 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191122/e0e9c477/attachment.bin>
More information about the cfe-commits
mailing list