diff options
author | Vasileios Porpodas <vporpodas@google.com> | 2022-11-28 14:45:59 -0800 |
---|---|---|
committer | Vasileios Porpodas <vporpodas@google.com> | 2022-12-01 15:37:51 -0800 |
commit | bebca2b6d559f545c82047b2071273b4c243d13b (patch) | |
tree | 3b9094a4323f7c58aeb49dd9553013c253a62511 /llvm/lib/Transforms/Utils/InlineFunction.cpp | |
parent | 467432899bc2f71842ed1b24d24c094da02af7d4 (diff) | |
download | llvm-bebca2b6d559f545c82047b2071273b4c243d13b.zip llvm-bebca2b6d559f545c82047b2071273b4c243d13b.tar.gz llvm-bebca2b6d559f545c82047b2071273b4c243d13b.tar.bz2 |
[NFC] Cleanup: Replaces BB->getInstList().splice() with BB->splice().
This is part of a series of cleanup patches towards making BasicBlock::getInstList() private.
Differential Revision: https://reviews.llvm.org/D138979
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 9ae6741..af2ae79 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -2411,8 +2411,8 @@ llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI, // Transfer all of the allocas over in a block. Using splice means // that the instructions aren't removed from the symbol table, then // reinserted. - Caller->getEntryBlock().getInstList().splice( - InsertPoint, FirstNewBlock->getInstList(), AI->getIterator(), I); + Caller->getEntryBlock().splice(InsertPoint, &*FirstNewBlock, + AI->getIterator(), I); } } @@ -2755,8 +2755,8 @@ llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI, // the calling basic block. if (Returns.size() == 1 && std::distance(FirstNewBlock, Caller->end()) == 1) { // Move all of the instructions right before the call. - OrigBB->getInstList().splice(CB.getIterator(), FirstNewBlock->getInstList(), - FirstNewBlock->begin(), FirstNewBlock->end()); + OrigBB->splice(CB.getIterator(), &*FirstNewBlock, FirstNewBlock->begin(), + FirstNewBlock->end()); // Remove the cloned basic block. Caller->getBasicBlockList().pop_back(); @@ -2896,8 +2896,7 @@ llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI, // Splice the code from the return block into the block that it will return // to, which contains the code that was after the call. - AfterCallBB->getInstList().splice(AfterCallBB->begin(), - ReturnBB->getInstList()); + AfterCallBB->splice(AfterCallBB->begin(), ReturnBB); if (CreatedBranchToNormalDest) CreatedBranchToNormalDest->setDebugLoc(Returns[0]->getDebugLoc()); @@ -2927,7 +2926,7 @@ llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI, // Splice the code entry block into calling block, right before the // unconditional branch. CalleeEntry->replaceAllUsesWith(OrigBB); // Update PHI nodes - OrigBB->getInstList().splice(Br->getIterator(), CalleeEntry->getInstList()); + OrigBB->splice(Br->getIterator(), CalleeEntry); // Remove the unconditional branch. Br->eraseFromParent(); |