OSDN Git Service

Correct the implelmentation of ConstantInt::getAllOnesValue() for bit
authorReid Spencer <rspencer@reidspencer.com>
Tue, 27 Feb 2007 07:57:53 +0000 (07:57 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Tue, 27 Feb 2007 07:57:53 +0000 (07:57 +0000)
widths > 64 bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34663 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Constants.cpp

index 64c2650..0c50796 100644 (file)
@@ -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;
 }