[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

Morris Hafner via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 24 05:13:23 PDT 2025


================
@@ -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);
----------------
mmha wrote:

It doesn't really make a difference because this is called by `startFunction` but shouldn't the return value always be in the function entry block?

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


More information about the cfe-commits mailing list