X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTransforms%2FIPO%2FIndMemRemoval.cpp;h=2f9c34d5cf6f7309dec8b357e2eca9b119b54ba7;hb=051a950000e21935165db56695e35bade668193b;hp=502c293da1d8448ea25e8080de89eaad1439715d;hpb=d963ab1f58adb6daa028533ff3285841d7e45f80;p=oota-llvm.git diff --git a/lib/Transforms/IPO/IndMemRemoval.cpp b/lib/Transforms/IPO/IndMemRemoval.cpp index 502c293da1d..2f9c34d5cf6 100644 --- a/lib/Transforms/IPO/IndMemRemoval.cpp +++ b/lib/Transforms/IPO/IndMemRemoval.cpp @@ -52,11 +52,11 @@ bool IndMemRemPass::runOnModule(Module &M) { if (Function* F = M.getFunction("free")) { assert(F->isDeclaration() && "free not external?"); if (!F->use_empty()) { - Function* FN = new Function(F->getFunctionType(), - GlobalValue::LinkOnceLinkage, - "free_llvm_bounce", &M); - BasicBlock* bb = new BasicBlock("entry",FN); - Instruction* R = new ReturnInst(bb); + Function* FN = Function::Create(F->getFunctionType(), + GlobalValue::LinkOnceLinkage, + "free_llvm_bounce", &M); + BasicBlock* bb = BasicBlock::Create("entry",FN); + Instruction* R = ReturnInst::Create(bb); new FreeInst(FN->arg_begin(), R); ++NumBounce; NumBounceSites += F->getNumUses(); @@ -67,14 +67,14 @@ bool IndMemRemPass::runOnModule(Module &M) { if (Function* F = M.getFunction("malloc")) { assert(F->isDeclaration() && "malloc not external?"); if (!F->use_empty()) { - Function* FN = new Function(F->getFunctionType(), - GlobalValue::LinkOnceLinkage, - "malloc_llvm_bounce", &M); - BasicBlock* bb = new BasicBlock("entry",FN); + Function* FN = Function::Create(F->getFunctionType(), + GlobalValue::LinkOnceLinkage, + "malloc_llvm_bounce", &M); + BasicBlock* bb = BasicBlock::Create("entry",FN); Instruction* c = CastInst::createIntegerCast( FN->arg_begin(), Type::Int32Ty, false, "c", bb); Instruction* a = new MallocInst(Type::Int8Ty, c, "m", bb); - new ReturnInst(a, bb); + ReturnInst::Create(a, bb); ++NumBounce; NumBounceSites += F->getNumUses(); F->replaceAllUsesWith(FN);