================
@@ -293,7 +294,8 @@ void CIRGenFunction::startFunction(GlobalDecl gd, QualType 
returnType,
 
     mlir::Value addrVal =
         emitAlloca(cast<NamedDecl>(paramVar)->getName(),
-                   convertType(paramVar->getType()), paramLoc, alignment);
+                   convertType(paramVar->getType()), paramLoc, alignment,
+                   /*insertIntoFnEntryBlock=*/false);
----------------
andykaylor wrote:

This is an optional argument in the incubator, and it defaults to false there. 
However, in the incubator, this call happens inside of `declare` so we don't 
know there that it's going into the entry block and instead rely on the 
location having been set.

This should always insert into the entry block, because we set the insertion 
point above. If I set this to `true`, emitAlloca will go through the process of 
finding the correct insertion point, saving, setting, and restoring, for each 
parameter value.

It's probably better to get rid of the `insertIntoFnEntyBlock` argument 
altogether and add a separate `emitAllocaIntoFnEntryBlock` function for the 
cases where that is needed.

https://github.com/llvm/llvm-project/pull/132468
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to