Hi,
I’m currently doing IR generation for the first time and was wondering if there are any differences in these three ways of inserting a block:
llvm::Function *cur_func = builder->GetInsertBlock()->getParent();
// method 1
llvm::BasicBlock *blk =
llvm::BasicBlock::Create(*context, "name", cur_func);
// method 2
llvm::BasicBlock *blk = llvm::BasicBlock::Create(*context, "name");
blk->insertInto(cur_func, nullptr);
// method 3 (newer?)
llvm::BasicBlock *blk = llvm::BasicBlock::Create(*context, "name");
cur_func->insert(cur_func->end(), blk);
With llvm 14 (debian default) the method 3 doesn’t seem to exist yet. Is there any difference between using these? It seems like under the hood it’s all just linked lists, but I thought maybe there’s some side-effects I should be aware of.