aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-16 18:39:06 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-16 18:39:06 +0000
commitec96a2d52d16e150baaf629cd35e3fabff5d8915 (patch)
tree1c7da035cc0d5bf39d736498cad14ea37555e1f7 /lib/Analysis/GRExprEngine.cpp
parente38718e3251d9f2489f38a5467fdab06f53e8e77 (diff)
Hook up "EvalStore" from GRTransferFuncs to GRExprEngine.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49804 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r--lib/Analysis/GRExprEngine.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 9c6a37dbad..72bae32231 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -689,7 +689,7 @@ void GRExprEngine::VisitLogicalExpr(BinaryOperator* B, NodeTy* Pred,
}
//===----------------------------------------------------------------------===//
-// Transfer functions: DeclRefExprs (loads, getting l-values).
+// Transfer functions: Loads and stores.
//===----------------------------------------------------------------------===//
void GRExprEngine::VisitDeclRefExpr(DeclRefExpr* D, NodeTy* Pred, NodeSet& Dst){
@@ -708,6 +708,23 @@ void GRExprEngine::VisitDeclRefExpr(DeclRefExpr* D, NodeTy* Pred, NodeSet& Dst){
MakeNode(Dst, D, Pred, SetBlkExprRVal(St, D, Y));
}
+void GRExprEngine::VisitStore(NodeSet& Dst, Expr* E, NodeTy* Pred,
+ ValueState* St, LVal TargetLV, RVal Val) {
+
+ assert (Builder && "GRStmtNodeBuilder must be defined.");
+
+ unsigned size = Dst.size();
+ SaveAndRestore<bool> OldSink(Builder->BuildSinks);
+
+ EvalStore(Dst, E, Pred, St, TargetLV, Val);
+
+ // Handle the case where no nodes where generated. Auto-generate that
+ // contains the updated state if we aren't generating sinks.
+
+ if (!Builder->BuildSinks && Dst.size() == size)
+ MakeNode(Dst, E, Pred, SetRVal(St, TargetLV, Val));
+}
+
//===----------------------------------------------------------------------===//
// Transfer function: Function calls.
//===----------------------------------------------------------------------===//
@@ -1637,7 +1654,7 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B,
// Simulate the effects of a "store": bind the value of the RHS
// to the L-Value represented by the LHS.
- EvalStore(Dst, B, N2, SetRVal(St, B, RightV),
+ VisitStore(Dst, B, N2, SetRVal(St, B, RightV),
cast<LVal>(LeftV), RightV);
// St = SetRVal(SetRVal(St, B, RightV), cast<LVal>(LeftV), RightV);
@@ -1788,7 +1805,7 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B,
}
// St = SetRVal(SetRVal(St, B, Result), LeftLV, Result);
- EvalStore(Dst, B, N2, SetRVal(St, B, Result), LeftLV, Result);
+ VisitStore(Dst, B, N2, SetRVal(St, B, Result), LeftLV, Result);
continue;
}
}