================
@@ -4490,6 +4490,35 @@ def CIR_TryOp : CIR_Op<"try",[
let hasLLVMLowering = false;
}
+//===----------------------------------------------------------------------===//
+// Exception related: EhInflightOp
+//===----------------------------------------------------------------------===//
+
+def CIR_EhInflightOp : CIR_Op<"eh.inflight_exception"> {
+ let summary = "Materialize the catch clause formal parameter";
+ let description = [{
+ `cir.eh.inflight_exception` returns two values:
+ - `exception_ptr`: The exception pointer for the inflight exception
+ - `type_id`: pointer to the exception object
+ This operation is expected to be the first one basic blocks on the
+ exception path out of `cir.try_call` operations.
+
+ The `cleanup` attribute indicates that clean up code might run before the
+ values produced by this operation are used to gather exception information.
+ This helps CIR to pass down more accurate information for LLVM lowering
+ to landingpads.
+ }];
+
+ let arguments = (ins UnitAttr:$cleanup,
+ OptionalAttr<FlatSymbolRefArrayAttr>:$sym_type_list);
+ let results = (outs CIR_VoidPtrType:$exception_ptr, CIR_UInt32:$type_id);
+ let assemblyFormat = [{
+ (`cleanup` $cleanup^)?
+ ($sym_type_list^)?
+ attr-dict
+ }];
----------------
xlauko wrote:
Add tests covering presence of cleanup and sym_type_list
https://github.com/llvm/llvm-project/pull/165621
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits