[clang] [CIR] Upstream initial function call support (PR #134673)

Sirui Mu via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 8 08:05:35 PDT 2025


================
@@ -466,8 +468,17 @@ CIRGenModule::createCIRFunction(mlir::Location loc, StringRef name,
   {
     mlir::OpBuilder::InsertionGuard guard(builder);
 
+    // Some global emissions are triggered while emitting a function, e.g.
+    // void s() { x.method() }
+    //
+    // Be sure to insert a new function before a current one.
+    if (curCGF)
----------------
Lancern wrote:

I don't see a clear code path that could change `curCGF`, but in case I missed something I updated the code and now it follows the incubator approach.

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


More information about the cfe-commits mailing list