diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-04-16 18:39:06 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-04-16 18:39:06 +0000 |
commit | 90c7cb6810e51d5990470ed575a9ea3cb1465ec8 (patch) | |
tree | a34f26440d4ebbbd58a84921b2876926e9f40f50 /clang/lib/Analysis/GRExprEngine.cpp | |
parent | ac375522e4996ee61b4751c5c48340f6271bdd0c (diff) | |
download | bcm5719-llvm-90c7cb6810e51d5990470ed575a9ea3cb1465ec8.tar.gz bcm5719-llvm-90c7cb6810e51d5990470ed575a9ea3cb1465ec8.zip |
Hook up "EvalStore" from GRTransferFuncs to GRExprEngine.
llvm-svn: 49804
Diffstat (limited to 'clang/lib/Analysis/GRExprEngine.cpp')
-rw-r--r-- | clang/lib/Analysis/GRExprEngine.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index 9c6a37dbadf..72bae322310 100644 --- a/clang/lib/Analysis/GRExprEngine.cpp +++ b/clang/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; } } |