aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-08-25 03:33:41 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-08-25 03:33:41 +0000
commitcc0255383f96a557c36923f602819bdb0cdd2761 (patch)
tree1e81f7083c79b8158d1476ae7c9f7f28c3ce7738 /lib/Analysis
parent9351c173cd538f7f7c28af1494ac7e68b815b0e8 (diff)
Remove Decl and CFG from ExplodedGraph. This leads to a series small changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79973 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/BugReporter.cpp3
-rw-r--r--lib/Analysis/CFRefCount.cpp2
-rw-r--r--lib/Analysis/GRCoreEngine.cpp6
-rw-r--r--lib/Analysis/GRExprEngine.cpp10
4 files changed, 10 insertions, 11 deletions
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index 1a77ecb55f..bda31fa4b7 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/lib/Analysis/BugReporter.cpp
@@ -1373,8 +1373,7 @@ MakeReportGraph(const ExplodedGraph* G,
// Create a new (third!) graph with a single path. This is the graph
// that will be returned to the caller.
- ExplodedGraph *GNew = new ExplodedGraph(GTrim->getCFG(), GTrim->getCodeDecl(),
- GTrim->getContext());
+ ExplodedGraph *GNew = new ExplodedGraph(GTrim->getContext());
// Sometimes the trimmed graph can contain a cycle. Perform a reverse BFS
// to the root node, and then construct a new graph that contains only
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index d1f293e40c..6d678f1c4f 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -3025,7 +3025,7 @@ void CFRefCount::EvalObjCMessageExpr(ExplodedNodeSet& Dst,
// Special-case: are we sending a mesage to "self"?
// This is a hack. When we have full-IP this should be removed.
- if (isa<ObjCMethodDecl>(&Eng.getGraph().getCodeDecl())) {
+ if (isa<ObjCMethodDecl>(Pred->getLocationContext()->getDecl())) {
if (Expr* Receiver = ME->getReceiver()) {
SVal X = St->getSValAsScalarOrLoc(Receiver);
if (loc::MemRegionVal* L = dyn_cast<loc::MemRegionVal>(&X)) {
diff --git a/lib/Analysis/GRCoreEngine.cpp b/lib/Analysis/GRCoreEngine.cpp
index 3ff27fc498..7983dd841b 100644
--- a/lib/Analysis/GRCoreEngine.cpp
+++ b/lib/Analysis/GRCoreEngine.cpp
@@ -151,7 +151,7 @@ bool GRCoreEngine::ExecuteWorkList(const LocationContext *L, unsigned Steps) {
if (G->num_roots() == 0) { // Initialize the analysis by constructing
// the root if none exists.
- CFGBlock* Entry = &getCFG().getEntry();
+ CFGBlock* Entry = &(L->getCFG()->getEntry());
assert (Entry->empty() &&
"Entry block must be empty.");
@@ -214,9 +214,9 @@ void GRCoreEngine::HandleBlockEdge(const BlockEdge& L, ExplodedNode* Pred) {
CFGBlock* Blk = L.getDst();
// Check if we are entering the EXIT block.
- if (Blk == &getCFG().getExit()) {
+ if (Blk == &(Pred->getLocationContext()->getCFG()->getExit())) {
- assert (getCFG().getExit().size() == 0
+ assert (Pred->getLocationContext()->getCFG()->getExit().size() == 0
&& "EXIT block cannot contain Stmts.");
// Process the final state transition.
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index ace75cb943..17baca7b65 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -153,7 +153,7 @@ GRExprEngine::GRExprEngine(CFG &cfg, const Decl &CD, ASTContext &Ctx,
StoreManagerCreator SMC,
ConstraintManagerCreator CMC)
: AMgr(mgr),
- CoreEngine(cfg, CD, Ctx, *this),
+ CoreEngine(Ctx, *this),
G(CoreEngine.getGraph()),
Liveness(L),
Builder(NULL),
@@ -316,7 +316,7 @@ void GRExprEngine::Visit(Stmt* S, ExplodedNode* Pred, ExplodedNodeSet& Dst) {
// this check when we KNOW that there is no block-level subexpression.
// The motivation is that this check requires a hashtable lookup.
- if (S != CurrentStmt && getCFG().isBlkExpr(S)) {
+ if (S != CurrentStmt && Pred->getLocationContext()->getCFG()->isBlkExpr(S)) {
Dst.Add(Pred);
return;
}
@@ -494,7 +494,7 @@ void GRExprEngine::VisitLValue(Expr* Ex, ExplodedNode* Pred,
Ex = Ex->IgnoreParens();
- if (Ex != CurrentStmt && getCFG().isBlkExpr(Ex)) {
+ if (Ex != CurrentStmt && Pred->getLocationContext()->getCFG()->isBlkExpr(Ex)) {
Dst.Add(Pred);
return;
}
@@ -807,7 +807,7 @@ void GRExprEngine::ProcessIndirectGoto(GRIndirectGotoNodeBuilder& builder) {
void GRExprEngine::VisitGuardedExpr(Expr* Ex, Expr* L, Expr* R,
ExplodedNode* Pred, ExplodedNodeSet& Dst) {
- assert (Ex == CurrentStmt && getCFG().isBlkExpr(Ex));
+ assert (Ex == CurrentStmt && Pred->getLocationContext()->getCFG()->isBlkExpr(Ex));
const GRState* state = GetState(Pred);
SVal X = state->getBlkExprSVal(Ex);
@@ -917,7 +917,7 @@ void GRExprEngine::VisitLogicalExpr(BinaryOperator* B, ExplodedNode* Pred,
assert(B->getOpcode() == BinaryOperator::LAnd ||
B->getOpcode() == BinaryOperator::LOr);
- assert(B == CurrentStmt && getCFG().isBlkExpr(B));
+ assert(B == CurrentStmt && Pred->getLocationContext()->getCFG()->isBlkExpr(B));
const GRState* state = GetState(Pred);
SVal X = state->getBlkExprSVal(B);