[clang] [CIR] Upstream CIR Dialect TryOp with Catch Attrs (PR #162897)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 10 14:48:19 PDT 2025


================
@@ -2878,6 +2878,120 @@ LogicalResult cir::TypeInfoAttr::verify(
   return success();
 }
 
+//===----------------------------------------------------------------------===//
+// TryOp
+//===----------------------------------------------------------------------===//
+
+void cir::TryOp::getSuccessorRegions(
+    mlir::RegionBranchPoint point, SmallVectorImpl<RegionSuccessor> &regions) {
+  // If any index all the underlying regions branch back to the parent
+  // operation.
+  if (!point.isParent()) {
+    regions.push_back(RegionSuccessor());
+    return;
+  }
+
+  // If the condition isn't constant, both regions may be executed.
----------------
andykaylor wrote:

I don't think this comment belongs here. It looks like a copy+paste error.

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


More information about the cfe-commits mailing list