[ManagedMemoryRewrite] Use unit64_t to store size, not int.

llvm-svn: 311440
This commit is contained in:
Siddharth Bhat 2017-08-22 09:30:37 +00:00
parent 603544863f
commit cb5155bf6d

View File

@ -311,7 +311,8 @@ static void rewriteAllocaAsManagedMemory(AllocaInst *Alloca,
Builder.SetInsertPoint(Alloca);
Value *MallocManagedFn = getOrCreatePollyMallocManaged(*Alloca->getModule());
const int Size = DL.getTypeAllocSize(Alloca->getType()->getElementType());
const uint64_t Size =
DL.getTypeAllocSize(Alloca->getType()->getElementType());
Value *SizeVal = Builder.getInt64(Size);
Value *RawManagedMem = Builder.CreateCall(MallocManagedFn, {SizeVal});
Value *Bitcasted = Builder.CreateBitCast(RawManagedMem, Alloca->getType());