From b83eb6447ba155342598f0fabe1f08f5baa9164a Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Fri, 20 Oct 2006 07:07:24 +0000 Subject: For PR950: This patch implements the first increment for the Signless Types feature. All changes pertain to removing the ConstantSInt and ConstantUInt classes in favor of just using ConstantInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/LowerAllocations.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Transforms/Utils/LowerAllocations.cpp') diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp index 451df70fef..d08235cd9d 100644 --- a/lib/Transforms/Utils/LowerAllocations.cpp +++ b/lib/Transforms/Utils/LowerAllocations.cpp @@ -119,14 +119,14 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) { // malloc(type) becomes sbyte *malloc(size) Value *MallocArg; if (LowerMallocArgToInteger) - MallocArg = ConstantUInt::get(Type::ULongTy, TD.getTypeSize(AllocTy)); + MallocArg = ConstantInt::get(Type::ULongTy, TD.getTypeSize(AllocTy)); else MallocArg = ConstantExpr::getSizeOf(AllocTy); MallocArg = ConstantExpr::getCast(cast(MallocArg), IntPtrTy); if (MI->isArrayAllocation()) { if (isa(MallocArg) && - cast(MallocArg)->getRawValue() == 1) { + cast(MallocArg)->getZExtValue() == 1) { MallocArg = MI->getOperand(0); // Operand * 1 = Operand } else if (Constant *CO = dyn_cast(MI->getOperand(0))) { CO = ConstantExpr::getCast(CO, IntPtrTy); -- cgit v1.2.3