================
@@ -309,6 +354,9 @@ void CIRGenFunction::popCleanupBlock() {
     assert(!cir::MissingFeatures::ehCleanupScopeRequiresEHCleanup());
     ehStack.popCleanup();
     scope.markEmitted();
+
+    mlir::OpBuilder::InsertionGuard guard(builder);
+    builder.setInsertionPointToStart(&cleanScope.getCleanupRegion().back());
     emitCleanup(*this, cleanup, cleanupFlags);
----------------
andykaylor wrote:

No, I'm pretty sure we want to handle that as a cleanup. How are you inserting 
your terminators? I have this working in my sandbox with just a couple of 
changes to the state this PR was in yesterday. Unfortunately, I didn't think to 
commit your changes locally before I started tinkering, so it'll take me a bit 
to figure out exactly what I changed.

https://github.com/llvm/llvm-project/pull/180276
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to