summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/CloneFunction.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2008-04-06 20:25:17 +0000
committerGabor Greif <ggreif@gmail.com>2008-04-06 20:25:17 +0000
commit051a950000e21935165db56695e35bade668193b (patch)
tree76db4bc690c153a1cfbd2989849c3b1d95500390 /lib/Transforms/Utils/CloneFunction.cpp
parentd963ab1f58adb6daa028533ff3285841d7e45f80 (diff)
downloadllvm-051a950000e21935165db56695e35bade668193b.tar.gz
llvm-051a950000e21935165db56695e35bade668193b.tar.bz2
llvm-051a950000e21935165db56695e35bade668193b.tar.xz
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
Diffstat (limited to 'lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r--lib/Transforms/Utils/CloneFunction.cpp10
1 files changed, 5 insertions, 5 deletions
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<const Value*, Value*> &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<BasicBlock*>(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<ConstantInt>(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;
}