summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-16 18:21:25 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-16 18:21:25 +0000
commit2044a5183d9d84c4050e39a68c8dc5c2f398dc77 (patch)
tree520d2311848a008b488c76af1090318594b84d89 /clang
parent8dc8a8d8af69cdb04f84377957d7b6b5674f9bb9 (diff)
downloadbcm5719-llvm-2044a5183d9d84c4050e39a68c8dc5c2f398dc77.tar.gz
bcm5719-llvm-2044a5183d9d84c4050e39a68c8dc5c2f398dc77.zip
Take first step to migrating handling of "stores" to values from GRExprEngine
to the plug-in GRTransferFuncs object. llvm-svn: 49801
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Analysis/PathSensitive/GRExprEngine.h7
-rw-r--r--clang/lib/Analysis/GRExprEngine.cpp11
2 files changed, 15 insertions, 3 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h b/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h
index 5548a5bf29e..0d8dfb32026 100644
--- a/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h
+++ b/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h
@@ -602,6 +602,13 @@ protected:
TF->EvalObjCMessageExpr(Dst, *this, *Builder, ME, Pred);
}
+ void EvalStore(NodeSet& Dst, Expr* E, NodeTy* Pred, ValueState* St,
+ LVal TargetLV, RVal Val) {
+
+ assert (Builder && "GRStmtNodeBuilder must be defined.");
+ MakeNode(Dst, E, Pred, SetRVal(St, TargetLV, Val));
+ }
+
ValueState* MarkBranch(ValueState* St, Stmt* Terminator, bool branchTaken);
};
} // end clang namespace
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp
index dfe319f0c95..9c6a37dbadf 100644
--- a/clang/lib/Analysis/GRExprEngine.cpp
+++ b/clang/lib/Analysis/GRExprEngine.cpp
@@ -1637,8 +1637,11 @@ 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.
- St = SetRVal(SetRVal(St, B, RightV), cast<LVal>(LeftV), RightV);
- break;
+ EvalStore(Dst, B, N2, SetRVal(St, B, RightV),
+ cast<LVal>(LeftV), RightV);
+
+// St = SetRVal(SetRVal(St, B, RightV), cast<LVal>(LeftV), RightV);
+ continue;
}
// Compound assignment operators.
@@ -1784,7 +1787,9 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B,
continue;
}
- St = SetRVal(SetRVal(St, B, Result), LeftLV, Result);
+ // St = SetRVal(SetRVal(St, B, Result), LeftLV, Result);
+ EvalStore(Dst, B, N2, SetRVal(St, B, Result), LeftLV, Result);
+ continue;
}
}
OpenPOWER on IntegriCloud