[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 19 06:17:24 PDT 2024


================
@@ -120,7 +120,8 @@ llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty,
     Alloca = Builder.CreateAlloca(Ty, ArraySize, Name);
   else
     Alloca = new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(),
-                                  ArraySize, Name, AllocaInsertPt);
+                                  ArraySize, Name,
+                                  (llvm::Instruction *)AllocaInsertPt);
----------------
nikic wrote:

```suggestion
                                  &*AllocaInsertPt);
```
Does something like this work instead?

https://github.com/llvm/llvm-project/pull/94226


More information about the cfe-commits mailing list