[clang] [CIR] Represent Cleanups with Cleanup scopes (PR #180276)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 18 11:13:03 PST 2026


================
@@ -363,8 +419,20 @@ void CIRGenFunction::popCleanupBlock() {
     ehStack.popCleanup();
     assert(ehStack.hasNormalCleanups() == hasEnclosingCleanups);
 
+    mlir::Block &block = cleanupScope.getCleanupRegion().back();
----------------
andykaylor wrote:

The code above and below the `emitCleanup` call is duplicated from above. Can you move it inside of `emitCleanup`?

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


More information about the cfe-commits mailing list