================
@@ -137,15 +136,15 @@ class IRBuilderBase {
public:
IRBuilderBase(LLVMContext &context, const IRBuilderFolder &Folder,
- const IRBuilderDefaultInserter &Inserter)
- : Context(context), Folder(Folder), Inserter(Inserter) {
+ InsertFn InsertCB)
+ : Context(context), Folder(Folder), InsertCB(InsertCB) {
ClearInsertionPoint();
}
/// Insert and return the specified instruction.
template<typename InstTy>
InstTy *Insert(InstTy *I, const Twine &Name = "") const {
- Inserter.InsertHelper(I, Name, InsertPt);
+ InsertCB(*this, I, Name, InsertPt);
----------------
fhahn wrote:
I think we allow copying to `IRBuilderBase` and could end up with a copied over
call back that would cast to a sub-type/specialized `IRBuilder`, which would be
UB.
It looks like we already delete copy assignment, perhaps we should just also
delete the copy ctor?
https://github.com/llvm/llvm-project/pull/229700
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits