diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-07-07 05:36:14 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-07-07 05:36:14 +0000 |
commit | 45d099b995acacb165367edc7f3d77eb3cc8407d (patch) | |
tree | ed8813118af9bf3d6dcfc6440f484a8ac2335ffd /clang/lib/CodeGen | |
parent | 763f9a50a5234fb27c0f03efd54b87ccdd7ca080 (diff) | |
download | bcm5719-llvm-45d099b995acacb165367edc7f3d77eb3cc8407d.tar.gz bcm5719-llvm-45d099b995acacb165367edc7f3d77eb3cc8407d.zip |
Cleanup. No functionality change intended.
llvm-svn: 212432
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index 046ee33271e..a4abc0fadbb 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -1618,12 +1618,11 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV, // 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. - if (value->getType()->getPrimitiveSizeInBits() >= - CGF.IntTy->getBitWidth() && - type->isSignedIntegerOrEnumerationType()) { + bool CanOverflow = value->getType()->getIntegerBitWidth() >= + CGF.IntTy->getIntegerBitWidth(); + if (CanOverflow && type->isSignedIntegerOrEnumerationType()) { value = EmitAddConsiderOverflowBehavior(E, value, amt, isInc); - } else if (value->getType()->getPrimitiveSizeInBits() >= - CGF.IntTy->getBitWidth() && type->isUnsignedIntegerType() && + } else if (CanOverflow && type->isUnsignedIntegerType() && CGF.SanOpts->UnsignedIntegerOverflow) { BinOpInfo BinOp; BinOp.LHS = value; |