aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp b/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
index 3631733713ab..2b706858cbed 100644
--- a/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
+++ b/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
@@ -60,7 +60,7 @@ bool unifyUnreachableBlocks(Function &F) {
new UnreachableInst(F.getContext(), UnreachableBlock);
for (BasicBlock *BB : UnreachableBlocks) {
- BB->getInstList().pop_back(); // Remove the unreachable inst.
+ BB->back().eraseFromParent(); // Remove the unreachable inst.
BranchInst::Create(UnreachableBlock, BB);
}
@@ -90,7 +90,7 @@ bool unifyReturnBlocks(Function &F) {
// If the function doesn't return void... add a PHI node to the block...
PN = PHINode::Create(F.getReturnType(), ReturningBlocks.size(),
"UnifiedRetVal");
- NewRetBlock->getInstList().push_back(PN);
+ PN->insertInto(NewRetBlock, NewRetBlock->end());
ReturnInst::Create(F.getContext(), PN, NewRetBlock);
}
@@ -102,7 +102,7 @@ bool unifyReturnBlocks(Function &F) {
if (PN)
PN->addIncoming(BB->getTerminator()->getOperand(0), BB);
- BB->getInstList().pop_back(); // Remove the return insn
+ BB->back().eraseFromParent(); // Remove the return insn
BranchInst::Create(NewRetBlock, BB);
}