[clang] [CIR][EH] Implement EH ABI lowering for dynamic exception specification (PR #223862)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 16 06:19:07 PDT 2026
================
@@ -4670,26 +4671,52 @@ mlir::LogicalResult CIRToLLVMEhInflightOpLowering::matchAndRewrite(
rewriter.setInsertionPointToStart(entryBlock);
mlir::Value addrOp = mlir::LLVM::AddressOfOp::create(
rewriter, loc, llvmPtrTy, symAttr.getValue());
- catchSymAddrs.push_back(addrOp);
+ landingPadClauses.push_back(addrOp);
}
}
// Emit a catch-all clause (catch ptr null) when:
// - The catch_all attribute is set (typed catches + catch-all), or
- // - No typed catches and no cleanup (legacy pure catch-all form)
- if (op.getCatchAll() || (!catchListAttr && !op.getCleanup())) {
+ // - No typed catches, no cleanup, and no filter (legacy pure catch-all)
+ if (op.getCatchAll() ||
+ (!catchListAttr && !op.getCleanup() && !filterListAttr)) {
mlir::OpBuilder::InsertionGuard guard(rewriter);
rewriter.setInsertionPointToStart(entryBlock);
mlir::Value nullOp = mlir::LLVM::ZeroOp::create(rewriter, loc, llvmPtrTy);
- catchSymAddrs.push_back(nullOp);
+ landingPadClauses.push_back(nullOp);
+ }
+
+ if (filterListAttr) {
----------------
erichkeane wrote:
I kinda wish we could combine the 3 if statements here/above into a structure that is a bit more organized. This whole bit is pretty disjoint...
https://github.com/llvm/llvm-project/pull/223862
More information about the cfe-commits
mailing list