diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp | 10 |
3 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp index e8201cc3915..0b597102d87 100644 --- a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp +++ b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp @@ -106,8 +106,7 @@ bool SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P) { BasicBlock *NewBB = new BasicBlock(TIBB->getName() + "." + DestBB->getName() + "_crit_edge"); // Create our unconditional branch... - BranchInst *BI = new BranchInst(DestBB); - NewBB->getInstList().push_back(BI); + new BranchInst(DestBB, 0, 0, NewBB); // Branch to the new block, breaking the edge... TI->setSuccessor(SuccNum, NewBB); diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 265d5c419ac..a0fc9bf1cff 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -238,7 +238,7 @@ bool InlineFunction(CallSite CS) { // invoke site. Once this happens, we know that the unwind would cause // a control transfer to the invoke exception destination, so we can // transform it into a direct branch to the exception destination. - BranchInst *BI = new BranchInst(InvokeDest, UI); + new BranchInst(InvokeDest, UI); // Delete the unwind instruction! UI->getParent()->getInstList().pop_back(); 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; |