forked from OSchip/llvm-project
Add transfer function support for pointer arithmetic where the
increment/decrement operand is on the left side. llvm-svn: 48144
This commit is contained in:
parent
b1de7a35f9
commit
afa02ed5fb
|
@ -428,7 +428,17 @@ protected:
|
|||
return TF->EvalBinOp(BasicVals, Op, cast<LVal>(L), cast<NonLVal>(R));
|
||||
}
|
||||
|
||||
return TF->EvalBinOp(BasicVals, Op, cast<NonLVal>(L), cast<NonLVal>(R));
|
||||
if (isa<LVal>(R)) {
|
||||
// Support pointer arithmetic where the increment/decrement operand
|
||||
// is on the left and the pointer on the right.
|
||||
|
||||
assert (Op == BinaryOperator::Add || Op == BinaryOperator::Sub);
|
||||
|
||||
// Commute the operands.
|
||||
return TF->EvalBinOp(BasicVals, Op, cast<LVal>(R), cast<NonLVal>(L));
|
||||
}
|
||||
else
|
||||
return TF->EvalBinOp(BasicVals, Op, cast<NonLVal>(L), cast<NonLVal>(R));
|
||||
}
|
||||
|
||||
void EvalCall(NodeSet& Dst, CallExpr* CE, LVal L, NodeTy* Pred) {
|
||||
|
|
Loading…
Reference in New Issue