From: Reid Spencer Date: Tue, 27 Feb 2007 07:57:53 +0000 (+0000) Subject: Correct the implelmentation of ConstantInt::getAllOnesValue() for bit X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8374db81a85e992867c052254273b1adf1bc5621;p=oota-llvm.git Correct the implelmentation of ConstantInt::getAllOnesValue() for bit widths > 64 bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34663 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 64c2650ec1d..0c507964331 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -118,7 +118,7 @@ ConstantInt *ConstantInt::getAllOnesValue(const Type *Ty) { if (ITy->getBitWidth() == 1) return ConstantInt::getTrue(); else - return ConstantInt::get(Ty, int64_t(-1)); + return ConstantInt::get(Ty, APInt::getAllOnesValue(ITy->getBitWidth())); return 0; }