[clang] [CIR] Simplify try-catch handling (PR #180857)
Henrich Lauko via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 10 23:58:39 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(
----------------
xlauko wrote:
This never uses catchRegion, should it be dropped?
https://github.com/llvm/llvm-project/pull/180857
More information about the cfe-commits
mailing list