forked from OSchip/llvm-project
Cleanup. No functionality change intended.
llvm-svn: 212432
This commit is contained in:
parent
763f9a50a5
commit
45d099b995
|
@ -1618,12 +1618,11 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV,
|
||||||
|
|
||||||
// Note that signed integer inc/dec with width less than int can't
|
// Note that signed integer inc/dec with width less than int can't
|
||||||
// overflow because of promotion rules; we're just eliding a few steps here.
|
// overflow because of promotion rules; we're just eliding a few steps here.
|
||||||
if (value->getType()->getPrimitiveSizeInBits() >=
|
bool CanOverflow = value->getType()->getIntegerBitWidth() >=
|
||||||
CGF.IntTy->getBitWidth() &&
|
CGF.IntTy->getIntegerBitWidth();
|
||||||
type->isSignedIntegerOrEnumerationType()) {
|
if (CanOverflow && type->isSignedIntegerOrEnumerationType()) {
|
||||||
value = EmitAddConsiderOverflowBehavior(E, value, amt, isInc);
|
value = EmitAddConsiderOverflowBehavior(E, value, amt, isInc);
|
||||||
} else if (value->getType()->getPrimitiveSizeInBits() >=
|
} else if (CanOverflow && type->isUnsignedIntegerType() &&
|
||||||
CGF.IntTy->getBitWidth() && type->isUnsignedIntegerType() &&
|
|
||||||
CGF.SanOpts->UnsignedIntegerOverflow) {
|
CGF.SanOpts->UnsignedIntegerOverflow) {
|
||||||
BinOpInfo BinOp;
|
BinOpInfo BinOp;
|
||||||
BinOp.LHS = value;
|
BinOp.LHS = value;
|
||||||
|
|
Loading…
Reference in New Issue