From a91ec25da0c8d1825fe383b8ddf2e6bf87171f4b 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. llvm-svn: 34663 --- llvm/lib/VMCore/Constants.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index 64c2650ec1d8..0c5079643310 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/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; } -- GitLab