diff options
author | Chris Lattner <sabre@nondot.org> | 2003-11-20 18:25:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-11-20 18:25:24 +0000 |
commit | 2af517281d6c36313f7ff74337a84c4fac716dbb (patch) | |
tree | f6d420f010d81c3328601e8073f8a573831d4223 /llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp | |
parent | 63a0ccff4496816a6774c1370237dd29c7062b09 (diff) | |
download | bcm5719-llvm-2af517281d6c36313f7ff74337a84c4fac716dbb.tar.gz bcm5719-llvm-2af517281d6c36313f7ff74337a84c4fac716dbb.zip |
Start using the nicer terminator auto-insertion API
llvm-svn: 10111
Diffstat (limited to 'llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp b/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp index 2591ffd6d72..18164220f84 100644 --- a/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp +++ b/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp @@ -61,13 +61,13 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) { UnwindBlock = UnwindingBlocks.front(); } else { UnwindBlock = new BasicBlock("UnifiedUnwindBlock", &F); - UnwindBlock->getInstList().push_back(new UnwindInst()); + new UnwindInst(UnwindBlock); for (std::vector<BasicBlock*>::iterator I = UnwindingBlocks.begin(), E = UnwindingBlocks.end(); I != E; ++I) { BasicBlock *BB = *I; BB->getInstList().pop_back(); // Remove the return insn - BB->getInstList().push_back(new BranchInst(UnwindBlock)); + new BranchInst(UnwindBlock, 0, 0, BB); } } @@ -91,10 +91,10 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) { // If the function doesn't return void... add a PHI node to the block... PN = new PHINode(F.getReturnType(), "UnifiedRetVal"); NewRetBlock->getInstList().push_back(PN); - NewRetBlock->getInstList().push_back(new ReturnInst(PN)); + new ReturnInst(PN, NewRetBlock); } else { // If it returns void, just add a return void instruction to the block - NewRetBlock->getInstList().push_back(new ReturnInst()); + new ReturnInst(0, NewRetBlock); } // Loop over all of the blocks, replacing the return instruction with an @@ -109,7 +109,7 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) { if (PN) PN->addIncoming(BB->getTerminator()->getOperand(0), BB); BB->getInstList().pop_back(); // Remove the return insn - BB->getInstList().push_back(new BranchInst(NewRetBlock)); + new BranchInst(NewRetBlock, 0, 0, BB); } ReturnBlock = NewRetBlock; return true; |