From 051a950000e21935165db56695e35bade668193b Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Sun, 6 Apr 2008 20:25:17 +0000 Subject: API changes for class Use size reduction, wave 1. Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49277 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/CloneFunction.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/Transforms/Utils/CloneFunction.cpp') diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp index 7387144b5e..ba9b57d4f5 100644 --- a/lib/Transforms/Utils/CloneFunction.cpp +++ b/lib/Transforms/Utils/CloneFunction.cpp @@ -31,7 +31,7 @@ BasicBlock *llvm::CloneBasicBlock(const BasicBlock *BB, DenseMap &ValueMap, const char *NameSuffix, Function *F, ClonedCodeInfo *CodeInfo) { - BasicBlock *NewBB = new BasicBlock("", F); + BasicBlock *NewBB = BasicBlock::Create("", F); if (BB->hasName()) NewBB->setName(BB->getName()+NameSuffix); NewBB->setUnwindDest(const_cast(BB->getUnwindDest())); @@ -144,7 +144,7 @@ Function *llvm::CloneFunction(const Function *F, ArgTypes, F->getFunctionType()->isVarArg()); // Create the new function... - Function *NewF = new Function(FTy, F->getLinkage(), F->getName()); + Function *NewF = Function::Create(FTy, F->getLinkage(), F->getName()); // Loop over the arguments, copying the names of the mapped arguments over... Function::arg_iterator DestI = NewF->arg_begin(); @@ -208,7 +208,7 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB, // Nope, clone it now. BasicBlock *NewBB; - BBEntry = NewBB = new BasicBlock(); + BBEntry = NewBB = BasicBlock::Create(); if (BB->hasName()) NewBB->setName(BB->getName()+NameSuffix); bool hasCalls = false, hasDynamicAllocas = false, hasStaticAllocas = false; @@ -253,7 +253,7 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB, // Constant fold to uncond branch! if (Cond) { BasicBlock *Dest = BI->getSuccessor(!Cond->getZExtValue()); - ValueMap[OldTI] = new BranchInst(Dest, NewBB); + ValueMap[OldTI] = BranchInst::Create(Dest, NewBB); ToClone.push_back(Dest); TerminatorDone = true; } @@ -265,7 +265,7 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB, Cond = dyn_cast_or_null(ValueMap[SI->getCondition()]); if (Cond) { // Constant fold to uncond branch! BasicBlock *Dest = SI->getSuccessor(SI->findCaseValue(Cond)); - ValueMap[OldTI] = new BranchInst(Dest, NewBB); + ValueMap[OldTI] = BranchInst::Create(Dest, NewBB); ToClone.push_back(Dest); TerminatorDone = true; } -- cgit v1.2.3