From: Craig Topper Date: Wed, 19 Apr 2017 20:32:11 +0000 (+0000) Subject: [APInt] Use SignExtend64 instead of reinventing it. NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a5ac74c2973db270ee003977f64d07c733bc9543;p=llvm [APInt] Use SignExtend64 instead of reinventing it. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300747 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h index b508c7770e2..cdcb178c97f 100644 --- a/include/llvm/ADT/APInt.h +++ b/include/llvm/ADT/APInt.h @@ -1433,8 +1433,7 @@ public: /// int64_t. Otherwise an assertion will result. int64_t getSExtValue() const { if (isSingleWord()) - return int64_t(VAL << (APINT_BITS_PER_WORD - BitWidth)) >> - (APINT_BITS_PER_WORD - BitWidth); + return SignExtend64(VAL, BitWidth); assert(getMinSignedBits() <= 64 && "Too many bits for int64_t"); return int64_t(pVal[0]); }