diff options
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/Analysis/PathSensitive/GRExprEngine.h | 11 | ||||
| -rw-r--r-- | clang/include/clang/Analysis/PathSensitive/GRTransferFuncs.h | 19 | ||||
| -rw-r--r-- | clang/lib/Analysis/GRSimpleVals.cpp | 5 | ||||
| -rw-r--r-- | clang/lib/Analysis/GRSimpleVals.h | 9 | ||||
| -rw-r--r-- | clang/lib/Analysis/GRTransferFuncs.cpp | 2 |
5 files changed, 29 insertions, 17 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h b/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h index 4a04247139b..0a0516e6024 100644 --- a/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h +++ b/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h @@ -548,12 +548,13 @@ protected: } RVal EvalBinOp(BinaryOperator::Opcode Op, NonLVal L, NonLVal R) { - return R.isValid() ? getTF().EvalBinOp(getStateManager(), Op, L, R) : R; + return R.isValid() ? getTF().DetermEvalBinOpNN(getStateManager(), Op, L, R) + : R; } RVal EvalBinOp(BinaryOperator::Opcode Op, NonLVal L, RVal R) { - return R.isValid() ? getTF().EvalBinOp(getStateManager(), Op, L, - cast<NonLVal>(R)) : R; + return R.isValid() ? getTF().DetermEvalBinOpNN(getStateManager(), Op, L, + cast<NonLVal>(R)) : R; } void EvalBinOp(ExplodedNodeSet<ValueState>& Dst, Expr* Ex, @@ -589,8 +590,8 @@ protected: cast<NonLVal>(L)); } else - return getTF().EvalBinOp(getStateManager(), Op, cast<NonLVal>(L), - cast<NonLVal>(R)); + return getTF().DetermEvalBinOpNN(getStateManager(), Op, cast<NonLVal>(L), + cast<NonLVal>(R)); } diff --git a/clang/include/clang/Analysis/PathSensitive/GRTransferFuncs.h b/clang/include/clang/Analysis/PathSensitive/GRTransferFuncs.h index db7de816214..8a9b9741d4d 100644 --- a/clang/include/clang/Analysis/PathSensitive/GRTransferFuncs.h +++ b/clang/include/clang/Analysis/PathSensitive/GRTransferFuncs.h @@ -25,6 +25,19 @@ namespace clang { class ObjCMessageExpr; class GRTransferFuncs { + + friend class GRExprEngine; + +protected: + + + virtual RVal DetermEvalBinOpNN(ValueStateManager& StateMgr, + BinaryOperator::Opcode Op, + NonLVal L, NonLVal R) { + return UnknownVal(); + } + + public: GRTransferFuncs() {} virtual ~GRTransferFuncs() {} @@ -47,12 +60,6 @@ public: virtual RVal EvalComplement(GRExprEngine& Engine, NonLVal X) = 0; // Binary Operators. - - virtual RVal EvalBinOp(ValueStateManager& StateMgr, BinaryOperator::Opcode Op, - NonLVal L, NonLVal R) { - return UnknownVal(); - } - virtual void EvalBinOpNN(ValueStateSet& OStates, ValueStateManager& StateMgr, const ValueState* St, Expr* Ex, BinaryOperator::Opcode Op, NonLVal L, NonLVal R); diff --git a/clang/lib/Analysis/GRSimpleVals.cpp b/clang/lib/Analysis/GRSimpleVals.cpp index f95ccb564f7..cc31ddddef8 100644 --- a/clang/lib/Analysis/GRSimpleVals.cpp +++ b/clang/lib/Analysis/GRSimpleVals.cpp @@ -450,8 +450,9 @@ RVal GRSimpleVals::EvalComplement(GRExprEngine& Eng, NonLVal X) { // Binary operators. -RVal GRSimpleVals::EvalBinOp(ValueStateManager& StateMgr, - BinaryOperator::Opcode Op, NonLVal L, NonLVal R) { +RVal GRSimpleVals::DetermEvalBinOpNN(ValueStateManager& StateMgr, + BinaryOperator::Opcode Op, + NonLVal L, NonLVal R) { BasicValueFactory& BasicVals = StateMgr.getBasicVals(); diff --git a/clang/lib/Analysis/GRSimpleVals.h b/clang/lib/Analysis/GRSimpleVals.h index fc20c3e5bc8..ac07f8b3241 100644 --- a/clang/lib/Analysis/GRSimpleVals.h +++ b/clang/lib/Analysis/GRSimpleVals.h @@ -25,6 +25,12 @@ class PathDiagnostic; class ASTContext; class GRSimpleVals : public GRTransferFuncs { +protected: + + virtual RVal DetermEvalBinOpNN(ValueStateManager& StateMgr, + BinaryOperator::Opcode Op, + NonLVal L, NonLVal R); + public: GRSimpleVals() {} virtual ~GRSimpleVals() {} @@ -44,9 +50,6 @@ public: // Binary Operators. - virtual RVal EvalBinOp(ValueStateManager& StateMgr, BinaryOperator::Opcode Op, - NonLVal L, NonLVal R); - virtual RVal EvalBinOp(GRExprEngine& Engine, BinaryOperator::Opcode Op, LVal L, LVal R); diff --git a/clang/lib/Analysis/GRTransferFuncs.cpp b/clang/lib/Analysis/GRTransferFuncs.cpp index 9d9c97f0edf..e30e0712c51 100644 --- a/clang/lib/Analysis/GRTransferFuncs.cpp +++ b/clang/lib/Analysis/GRTransferFuncs.cpp @@ -44,5 +44,5 @@ void GRTransferFuncs::EvalBinOpNN(ValueStateSet& OStates, BinaryOperator::Opcode Op, NonLVal L, NonLVal R) { - OStates.Add(StateMgr.SetRVal(St, Ex, EvalBinOp(StateMgr, Op, L, R))); + OStates.Add(StateMgr.SetRVal(St, Ex, DetermEvalBinOpNN(StateMgr, Op, L, R))); } |

