aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/BasicBlock.cpp
diff options
context:
space:
mode:
authorVasileios Porpodas <vporpodas@google.com>2022-12-12 14:57:47 -0800
committerVasileios Porpodas <vporpodas@google.com>2022-12-12 20:22:55 -0800
commita19ae77d2a9016428fee7cd5af03fd20ad6d4464 (patch)
tree68a8db9ead83aef2289609fac4be9bbf22828a8c /llvm/lib/IR/BasicBlock.cpp
parent1bf261c89b96df33ed14c6695f5f8590578e825d (diff)
downloadllvm-a19ae77d2a9016428fee7cd5af03fd20ad6d4464.zip
llvm-a19ae77d2a9016428fee7cd5af03fd20ad6d4464.tar.gz
llvm-a19ae77d2a9016428fee7cd5af03fd20ad6d4464.tar.bz2
[IR][NFC] Adds Function::insertBasicBlockAt() to replace things like F->getBasicBlockList().insert()
This is part of a series of patches that aim at making Function::getBasicBlockList() private. Differential Revision: https://reviews.llvm.org/D139906
Diffstat (limited to 'llvm/lib/IR/BasicBlock.cpp')
-rw-r--r--llvm/lib/IR/BasicBlock.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp
index f2ecd6e..0030ff6 100644
--- a/llvm/lib/IR/BasicBlock.cpp
+++ b/llvm/lib/IR/BasicBlock.cpp
@@ -62,9 +62,9 @@ void BasicBlock::insertInto(Function *NewParent, BasicBlock *InsertBefore) {
assert(!Parent && "Already has a parent");
if (InsertBefore)
- NewParent->getBasicBlockList().insert(InsertBefore->getIterator(), this);
+ NewParent->insertBasicBlockAt(InsertBefore->getIterator(), this);
else
- NewParent->getBasicBlockList().push_back(this);
+ NewParent->insertBasicBlockAt(NewParent->end(), this);
}
BasicBlock::~BasicBlock() {