diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-09-10 22:38:49 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-09-10 22:38:49 +0000 |
| commit | f80f7b02b70cfb5c710b2e37750ecd91b28e7a27 (patch) | |
| tree | 5b0e924e4d9538a1dcf07d74f113dc4e2b31d737 /llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp | |
| parent | a239e6879d111e50457970a35013f6abedfa7e5c (diff) | |
| download | bcm5719-llvm-f80f7b02b70cfb5c710b2e37750ecd91b28e7a27.tar.gz bcm5719-llvm-f80f7b02b70cfb5c710b2e37750ecd91b28e7a27.zip | |
Clean up code due to auto-insert constructors
llvm-svn: 3666
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 3c522b53ab0..5c1e86b4a16 100644 --- a/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp +++ b/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp @@ -49,8 +49,8 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) { if (F.getReturnType() != Type::VoidTy) { // If the function doesn't return void... add a PHI node to the block... - PHINode *PN = new PHINode(F.getReturnType(), "UnifiedRetVal"); - NewRetBlock->getInstList().push_back(PN); + PHINode *PN = new PHINode(F.getReturnType(), "UnifiedRetVal", + NewRetBlock.end()); // Add an incoming element to the PHI node for every return instruction that // is merging into this new block... @@ -59,10 +59,10 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) { PN->addIncoming((*I)->getTerminator()->getOperand(0), *I); // Add a return instruction to return the result of the PHI node... - NewRetBlock->getInstList().push_back(new ReturnInst(PN)); + new ReturnInst(PN, NewRetBlock.end()); } else { // If it returns void, just add a return void instruction to the block - NewRetBlock->getInstList().push_back(new ReturnInst()); + new ReturnInst(0, NewRetBlock.end()); } // Loop over all of the blocks, replacing the return instruction with an @@ -71,7 +71,7 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) { for (vector<BasicBlock*>::iterator I = ReturningBlocks.begin(), E = ReturningBlocks.end(); I != E; ++I) { (*I)->getInstList().pop_back(); // Remove the return insn - (*I)->getInstList().push_back(new BranchInst(NewRetBlock)); + new BranchInst(NewRetBlock, (*I)->end()); } ExitNode = NewRetBlock; return true; |

