================
@@ -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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to