Driver now passes the top-level FunctionDecl* to GRConstants.
Refactoring: for GREngine and GRConstants, pushed references to CFG, ASTContext,
and the top-level FunctionDecl into ExplodedGraphImpl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46475 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Analysis/GREngine.cpp b/Analysis/GREngine.cpp
index f0c59cf..65cfb24 100644
--- a/Analysis/GREngine.cpp
+++ b/Analysis/GREngine.cpp
@@ -56,7 +56,7 @@
if (G->num_roots() == 0) { // Initialize the analysis by constructing
// the root if none exists.
- CFGBlock* Entry = &cfg.getEntry();
+ CFGBlock* Entry = &getCFG().getEntry();
assert (Entry->empty() &&
"Entry block must be empty.");
@@ -69,7 +69,7 @@
// Construct an edge representing the
// starting location in the function.
- BlockEdge StartLoc(cfg, Entry, Succ);
+ BlockEdge StartLoc(getCFG(), Entry, Succ);
// Generate the root.
GenerateNode(StartLoc, getInitialState());
@@ -110,9 +110,10 @@
CFGBlock* Blk = L.getDst();
// Check if we are entering the EXIT block.
- if (Blk == &cfg.getExit()) {
+ if (Blk == &getCFG().getExit()) {
- assert (cfg.getExit().size() == 0 && "EXIT block cannot contain Stmts.");
+ assert (getCFG().getExit().size() == 0
+ && "EXIT block cannot contain Stmts.");
// Process the final state transition.
void* State = ProcessEOP(Blk, Pred->State);
@@ -154,7 +155,7 @@
assert (B->succ_size() == 1 &&
"Blocks with no terminator should have at most 1 successor.");
- GenerateNode(BlockEdge(cfg,B,*(B->succ_begin())), Pred->State, Pred);
+ GenerateNode(BlockEdge(getCFG(),B,*(B->succ_begin())), Pred->State, Pred);
}
}