From 8374db81a85e992867c052254273b1adf1bc5621 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Tue, 27 Feb 2007 07:57:53 +0000 Subject: [PATCH] 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 --- lib/VMCore/Constants.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }