diff options
Diffstat (limited to 'lib/Checker/GRState.cpp')
-rw-r--r-- | lib/Checker/GRState.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/Checker/GRState.cpp b/lib/Checker/GRState.cpp index 2defbcd..f68e10b 100644 --- a/lib/Checker/GRState.cpp +++ b/lib/Checker/GRState.cpp @@ -11,10 +11,10 @@ // //===----------------------------------------------------------------------===// +#include "clang/Analysis/CFG.h" #include "clang/Checker/PathSensitive/GRStateTrait.h" #include "clang/Checker/PathSensitive/GRState.h" #include "clang/Checker/PathSensitive/GRTransferFuncs.h" -#include "llvm/ADT/SmallSet.h" #include "llvm/Support/raw_ostream.h" using namespace clang; @@ -227,6 +227,18 @@ const GRState* GRStateManager::addGDM(const GRState* St, void* Key, void* Data){ return getPersistentState(NewSt); } +const GRState *GRStateManager::removeGDM(const GRState *state, void *Key) { + GRState::GenericDataMap OldM = state->getGDM(); + GRState::GenericDataMap NewM = GDMFactory.Remove(OldM, Key); + + if (NewM == OldM) + return state; + + GRState NewState = *state; + NewState.GDM = NewM; + return getPersistentState(NewState); +} + //===----------------------------------------------------------------------===// // Utility. //===----------------------------------------------------------------------===// |