Small tweaks to EvalStore: pass an "RVal" instead of "LVal" for the TargetLV to
represent possible stores to "Unknown."
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49811 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/GRTransferFuncs.cpp b/lib/Analysis/GRTransferFuncs.cpp
index d11d18d..9c96e3d 100644
--- a/lib/Analysis/GRTransferFuncs.cpp
+++ b/lib/Analysis/GRTransferFuncs.cpp
@@ -13,7 +13,27 @@
//===----------------------------------------------------------------------===//
#include "clang/Analysis/PathSensitive/GRTransferFuncs.h"
+#include "clang/Analysis/PathSensitive/GRExprEngine.h"
using namespace clang;
void GRTransferFuncs::RegisterChecks(GRExprEngine& Eng) {}
+
+void GRTransferFuncs::EvalStore(ExplodedNodeSet<ValueState>& Dst,
+ GRExprEngine& Eng,
+ GRStmtNodeBuilder<ValueState>& Builder,
+ Expr* E, ExplodedNode<ValueState>* Pred,
+ ValueState* St, RVal TargetLV, RVal Val) {
+
+ // This code basically matches the "safety-net" logic of GRExprEngine:
+ // bind Val to TargetLV, and create a new node. We replicate it here
+ // because subclasses of GRTransferFuncs may wish to call it.
+
+ assert (!TargetLV.isUndef());
+
+ if (TargetLV.isUnknown())
+ Builder.MakeNode(Dst, E, Pred, St);
+ else
+ Builder.MakeNode(Dst, E, Pred,
+ Eng.getStateManager().SetRVal(St, cast<LVal>(TargetLV), Val));
+}