aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Analysis/PathSensitive/GRTransferFuncs.h')
-rw-r--r--include/clang/Analysis/PathSensitive/GRTransferFuncs.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/clang/Analysis/PathSensitive/GRTransferFuncs.h b/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
index 87ff170372..19e87dcd94 100644
--- a/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
+++ b/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
@@ -47,12 +47,25 @@ public:
BinaryOperator::Opcode Op,
LValue LHS, LValue RHS);
-
// Pointer arithmetic.
virtual LValue EvalBinaryOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
LValue LHS, NonLValue RHS) = 0;
+ inline RValue EvalBinaryOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
+ const RValue& L, const RValue& R) {
+
+ if (isa<LValue>(L)) {
+ if (isa<LValue>(R))
+ return EvalBinaryOp(ValMgr, Op, cast<LValue>(L), cast<LValue>(R));
+ else
+ return EvalBinaryOp(ValMgr, Op, cast<LValue>(L), cast<NonLValue>(R));
+ }
+ else
+ return EvalBinaryOp(ValMgr, Op, cast<NonLValue>(L), cast<NonLValue>(R));
+ }
+
+
// Equality operators for LValues.
virtual NonLValue EvalEQ(ValueManager& ValMgr, LValue LHS, LValue RHS) = 0;
virtual NonLValue EvalNE(ValueManager& ValMgr, LValue LHS, LValue RHS) = 0;