diff options
author | Vasileios Porpodas <vporpodas@google.com> | 2022-11-28 14:43:11 -0800 |
---|---|---|
committer | Vasileios Porpodas <vporpodas@google.com> | 2022-12-12 13:33:05 -0800 |
commit | 06911ba6ea1e552d3bcaed2728c92a9aa6cbf4d2 (patch) | |
tree | bf4f7cf10a99e47d1867a88bb794c13f986b54c3 /llvm/lib/Transforms/Utils/CloneFunction.cpp | |
parent | 816b5e546c6553afd463f9630b248a17702700c9 (diff) | |
download | llvm-06911ba6ea1e552d3bcaed2728c92a9aa6cbf4d2.zip llvm-06911ba6ea1e552d3bcaed2728c92a9aa6cbf4d2.tar.gz llvm-06911ba6ea1e552d3bcaed2728c92a9aa6cbf4d2.tar.bz2 |
[NFC] Cleanup: Replaces BB->getInstList().insert() with I->insertAt().
This is part of a series of cleanup patches towards making BasicBlock::getInstList() private.
Differential Revision: https://reviews.llvm.org/D138877
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CloneFunction.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index f660eed..22807ec 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp @@ -58,7 +58,7 @@ BasicBlock *llvm::CloneBasicBlock(const BasicBlock *BB, ValueToValueMapTy &VMap, Instruction *NewInst = I.clone(); if (I.hasName()) NewInst->setName(I.getName() + NameSuffix); - NewBB->getInstList().push_back(NewInst); + NewInst->insertAt(NewBB, NewBB->end()); VMap[&I] = NewInst; // Add instruction map to value. if (isa<CallInst>(I) && !I.isDebugOrPseudoInst()) { @@ -521,7 +521,7 @@ void PruningFunctionCloner::CloneBlock( if (II->hasName()) NewInst->setName(II->getName() + NameSuffix); VMap[&*II] = NewInst; // Add instruction map to value. - NewBB->getInstList().push_back(NewInst); + NewInst->insertAt(NewBB, NewBB->end()); if (isa<CallInst>(II) && !II->isDebugOrPseudoInst()) { hasCalls = true; hasMemProfMetadata |= II->hasMetadata(LLVMContext::MD_memprof); @@ -583,7 +583,7 @@ void PruningFunctionCloner::CloneBlock( Instruction *NewInst = OldTI->clone(); if (OldTI->hasName()) NewInst->setName(OldTI->getName() + NameSuffix); - NewBB->getInstList().push_back(NewInst); + NewInst->insertAt(NewBB, NewBB->end()); VMap[OldTI] = NewInst; // Add instruction map to value. if (CodeInfo) { |