diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-03-06 09:23:02 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-03-06 09:23:02 +0000 |
commit | d2e6cf1d1c6468396ec057119c32aa58b1ee5ac9 (patch) | |
tree | 7e0a88c3c6cb70271946aaa95a231b3da55d9f91 /lib/Checker | |
parent | df90325d4c0a65ee64d2dae3ed9b5b34f7418533 (diff) | |
download | FreeBSD-src-d2e6cf1d1c6468396ec057119c32aa58b1ee5ac9.zip FreeBSD-src-d2e6cf1d1c6468396ec057119c32aa58b1ee5ac9.tar.gz |
Update clang to r97873.
Diffstat (limited to 'lib/Checker')
-rw-r--r-- | lib/Checker/Environment.cpp | 8 | ||||
-rw-r--r-- | lib/Checker/GRExprEngine.cpp | 7 | ||||
-rw-r--r-- | lib/Checker/GRState.cpp | 14 | ||||
-rw-r--r-- | lib/Checker/SymbolManager.cpp | 10 |
4 files changed, 21 insertions, 18 deletions
diff --git a/lib/Checker/Environment.cpp b/lib/Checker/Environment.cpp index c2c9190..671cf89 100644 --- a/lib/Checker/Environment.cpp +++ b/lib/Checker/Environment.cpp @@ -78,12 +78,12 @@ Environment EnvironmentManager::BindExpr(Environment Env, const Stmt *S, if (V.isUnknown()) { if (Invalidate) - return Environment(F.Remove(Env.ExprBindings, S), Env.ACtx); + return Environment(F.Remove(Env.ExprBindings, S)); else return Env; } - return Environment(F.Add(Env.ExprBindings, S, V), Env.ACtx); + return Environment(F.Add(Env.ExprBindings, S, V)); } namespace { @@ -109,12 +109,12 @@ EnvironmentManager::RemoveDeadBindings(Environment Env, const Stmt *S, const GRState *ST, llvm::SmallVectorImpl<const MemRegion*> &DRoots) { - CFG &C = *Env.getAnalysisContext().getCFG(); + CFG &C = *SymReaper.getLocationContext()->getCFG(); // We construct a new Environment object entirely, as this is cheaper than // individually removing all the subexpression bindings (which will greatly // outnumber block-level expression bindings). - Environment NewEnv = getInitialEnvironment(&Env.getAnalysisContext()); + Environment NewEnv = getInitialEnvironment(); // Iterate over the block-expr bindings. for (Environment::iterator I = Env.begin(), E = Env.end(); diff --git a/lib/Checker/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp index ad229c7..2ea689e 100644 --- a/lib/Checker/GRExprEngine.cpp +++ b/lib/Checker/GRExprEngine.cpp @@ -477,8 +477,9 @@ void GRExprEngine::ProcessStmt(CFGElement CE, GRStmtNodeBuilder& builder) { // Create the cleaned state. const ExplodedNode *BasePred = Builder->getBasePredecessor(); - SymbolReaper SymReaper(BasePred->getLiveVariables(), SymMgr, - BasePred->getLocationContext()->getCurrentStackFrame()); + + SymbolReaper SymReaper(BasePred->getLocationContext(), SymMgr); + CleanedState = AMgr.shouldPurgeDead() ? StateMgr.RemoveDeadBindings(EntryNode->getState(), CurrentStmt, SymReaper) : EntryNode->getState(); @@ -3319,7 +3320,7 @@ struct DOTGraphTraits<ExplodedNode*> : Out << "\\|StateID: " << (void*) N->getState() << "\\|"; const GRState *state = N->getState(); - state->printDOT(Out); + state->printDOT(Out, *N->getLocationContext()->getCFG()); Out << "\\l"; return Out.str(); diff --git a/lib/Checker/GRState.cpp b/lib/Checker/GRState.cpp index 592f930..97ede1d 100644 --- a/lib/Checker/GRState.cpp +++ b/lib/Checker/GRState.cpp @@ -99,7 +99,7 @@ const GRState *GRState::BindExpr(const Stmt* Ex, SVal V, bool Invalidate) const{ const GRState* GRStateManager::getInitialState(const LocationContext *InitLoc) { GRState State(this, - EnvMgr.getInitialEnvironment(InitLoc->getAnalysisContext()), + EnvMgr.getInitialEnvironment(), StoreMgr->getInitialStore(InitLoc), GDMFactory.GetEmptyMap()); @@ -131,14 +131,12 @@ const GRState* GRState::makeWithStore(Store store) const { // State pretty-printing. //===----------------------------------------------------------------------===// -void GRState::print(llvm::raw_ostream& Out, const char* nl, +void GRState::print(llvm::raw_ostream& Out, CFG &C, const char* nl, const char* sep) const { // Print the store. GRStateManager &Mgr = getStateManager(); Mgr.getStoreManager().print(getStore(), Out, nl, sep); - CFG &C = *getAnalysisContext().getCFG(); - // Print Subexpression bindings. bool isFirst = true; @@ -186,12 +184,12 @@ void GRState::print(llvm::raw_ostream& Out, const char* nl, } } -void GRState::printDOT(llvm::raw_ostream& Out) const { - print(Out, "\\l", "\\|"); +void GRState::printDOT(llvm::raw_ostream& Out, CFG &C) const { + print(Out, C, "\\l", "\\|"); } -void GRState::printStdErr() const { - print(llvm::errs()); +void GRState::printStdErr(CFG &C) const { + print(llvm::errs(), C); } //===----------------------------------------------------------------------===// diff --git a/lib/Checker/SymbolManager.cpp b/lib/Checker/SymbolManager.cpp index f2d630c..65a46e3 100644 --- a/lib/Checker/SymbolManager.cpp +++ b/lib/Checker/SymbolManager.cpp @@ -215,13 +215,17 @@ bool SymbolReaper::isLive(SymbolRef sym) { return isa<SymbolRegionValue>(sym); } +bool SymbolReaper::isLive(const Stmt* Loc, const Stmt* ExprVal) const { + return LCtx->getLiveVariables()->isLive(Loc, ExprVal); +} + bool SymbolReaper::isLive(const Stmt *Loc, const VarRegion *VR) const { const StackFrameContext *SFC = VR->getStackFrame(); - if (SFC == CurrentStackFrame) - return Liveness.isLive(Loc, VR->getDecl()); + if (SFC == LCtx->getCurrentStackFrame()) + return LCtx->getLiveVariables()->isLive(Loc, VR->getDecl()); else - return SFC->isParentOf(CurrentStackFrame); + return SFC->isParentOf(LCtx->getCurrentStackFrame()); } SymbolVisitor::~SymbolVisitor() {} |