summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/RaiseAllocations.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/IPO/RaiseAllocations.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/RaiseAllocations.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/IPO/RaiseAllocations.cpp b/llvm/lib/Transforms/IPO/RaiseAllocations.cpp
index 77a9a3d57ea..46c6815994f 100644
--- a/llvm/lib/Transforms/IPO/RaiseAllocations.cpp
+++ b/llvm/lib/Transforms/IPO/RaiseAllocations.cpp
@@ -141,8 +141,8 @@ bool RaiseAllocations::runOnModule(Module &M) {
// source size.
if (Source->getType() != Type::UIntTy)
Source =
- CastInst::createInferredCast(Source, Type::UIntTy,
- "MallocAmtCast", I);
+ CastInst::createIntegerCast(Source, Type::UIntTy, false/*ZExt*/,
+ "MallocAmtCast", I);
std::string Name(I->getName()); I->setName("");
MallocInst *MI = new MallocInst(Type::SByteTy, Source, Name, I);
@@ -193,8 +193,8 @@ bool RaiseAllocations::runOnModule(Module &M) {
//
Value *Source = *CS.arg_begin();
if (!isa<PointerType>(Source->getType()))
- Source = CastInst::createInferredCast(
- Source, PointerType::get(Type::SByteTy), "FreePtrCast", I);
+ Source = new IntToPtrInst(Source, PointerType::get(Type::SByteTy),
+ "FreePtrCast", I);
new FreeInst(Source, I);
// If the old instruction was an invoke, add an unconditional branch
OpenPOWER on IntegriCloud