[clang] [CIR] Upstream Exception ThrowOp with subexpr (PR #161818)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 6 11:50:13 PDT 2025


================
@@ -178,3 +178,36 @@ void CIRGenFunction::popCleanupBlocks(
     popCleanupBlock();
   }
 }
+
+void CIRGenFunction::deactivateCleanupBlock(
+    EHScopeStack::stable_iterator cleanup, mlir::Operation *dominatingIP) {
+  assert(cleanup != ehStack.stable_end() && "deactivating bottom of stack?");
+  EHCleanupScope &scope = cast<EHCleanupScope>(*ehStack.find(cleanup));
+  assert(scope.isActive() && "double deactivation");
+
+  // If it's the top of the stack, just pop it, but do so only if it belongs
+  // to the current RunCleanupsScope.
+  if (cleanup == ehStack.stable_begin() &&
+      currentCleanupStackDepth.strictlyEncloses(cleanup)) {
+
+    // Per comment below, checking EHAsynch is not really necessary
----------------
andykaylor wrote:

It's not clear to me what "comments below" this is referring to or why checking EHAsynch is not really necessary.

This code changed last year in classic codegen last year. Can you update this PR to reflect the changes here: https://github.com/llvm/llvm-project/pull/89154

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


More information about the cfe-commits mailing list