[clang] [CIR] Simplify try-catch handling (PR #180857)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 11 09:12:33 PST 2026


================
@@ -243,27 +243,33 @@ void CIRGenFunction::emitAnyExprToExn(const Expr *e, Address addr) {
   assert(!cir::MissingFeatures::ehCleanupScope());
 }
 
-void CIRGenFunction::populateUnwindResumeBlock(bool isCleanup,
-                                               cir::TryOp tryOp) {
-  const EHPersonality &personality = EHPersonality::get(*this);
-  // This can always be a call because we necessarily didn't find
-  // anything on the EH stack which needs our help.
-  const char *rethrowName = personality.catchallRethrowFn;
-  if (rethrowName != nullptr && !isCleanup) {
-    cgm.errorNYI("populateUnwindResumeBlock CatchallRethrowFn");
-    return;
-  }
-
-  unsigned regionsNum = tryOp->getNumRegions();
-  mlir::Region *unwindRegion = &tryOp->getRegion(regionsNum - 1);
-  mlir::Block *unwindResumeBlock = &unwindRegion->front();
-  if (!unwindResumeBlock->empty())
-    return;
+void CIRGenFunction::addCatchHandlerAttr(
----------------
andykaylor wrote:

Yes, it can be. I was originally trying to emit the catch handler body here and when I removed that I didn't think about the parameters again.

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


More information about the cfe-commits mailing list