if (!liveness) {
liveness.reset(new LiveVariables(*getCFG()));
liveness->runOnCFG(*getCFG());
+ liveness->runOnAllBlocks(*getCFG(), 0, true);
}
return liveness.get();
}
mgr.DisplayFunction();
// Construct the analysis engine.
- GRExprEngine Eng(*mgr.getCFG(), *mgr.getCodeDecl(), mgr.getContext());
+ GRExprEngine Eng(*mgr.getCFG(), *mgr.getCodeDecl(), mgr.getContext(),
+ *mgr.getLiveVariables());
Eng.setTransferFunctions(tf);
// Execute the worklist algorithm.
/// Liveness - live-variables information the ValueDecl* and block-level
/// Expr* in the CFG. Used to prune out dead state.
- LiveVariables Liveness;
+ LiveVariables& Liveness;
/// DeadSymbols - A scratch set used to record the set of symbols that
/// were just marked dead by a call to ValueStateManager::RemoveDeadBindings.
UndefArgsTy MsgExprUndefArgs;
public:
- GRExprEngine(CFG& cfg, Decl& CD, ASTContext& Ctx);
+ GRExprEngine(CFG& cfg, Decl& CD, ASTContext& Ctx, LiveVariables& L);
~GRExprEngine();
void ExecuteWorkList(unsigned Steps = 150000) {
}
-GRExprEngine::GRExprEngine(CFG& cfg, Decl& CD, ASTContext& Ctx)
+GRExprEngine::GRExprEngine(CFG& cfg, Decl& CD, ASTContext& Ctx,
+ LiveVariables& L)
: CoreEngine(cfg, CD, Ctx, *this),
G(CoreEngine.getGraph()),
Parents(0),
- Liveness(G.getCFG()),
+ Liveness(L),
Builder(NULL),
StateMgr(G.getContext(), G.getAllocator()),
BasicVals(StateMgr.getBasicValueFactory()),
SymMgr(StateMgr.getSymbolManager()),
CurrentStmt(NULL),
NSExceptionII(NULL), NSExceptionInstanceRaiseSelectors(NULL),
- RaiseSel(GetNullarySelector("raise", G.getContext())) {
-
- // Compute liveness information.
- Liveness.runOnCFG(G.getCFG());
- Liveness.runOnAllBlocks(G.getCFG(), NULL, true);
-}
+ RaiseSel(GetNullarySelector("raise", G.getContext())) {}
GRExprEngine::~GRExprEngine() {
for (BugTypeSet::iterator I = BugTypes.begin(), E = BugTypes.end(); I!=E; ++I)