================
@@ -350,11 +350,22 @@ the destructor. Therefore, this cleanup handler is marked 
as eh_only.
 Try-catch blocks will be represented, as they are in the ClangIR
 incubator project, using a `cir.try` operation.
 
+The `cir.catch_param` operation is used to represent the capturing of the
+exception object in an ABI-independent way. When the catch handler includes
+a source variable representing the exception object, the result of the
+`cir.catch_param` operation will be stored to an alloca object for the
+source variable.  If the handler is a catch-all, the `cir.catch_param` 
operation
+will return a pointer to void, but this cannot be captured by a source 
variable.
----------------
erichkeane wrote:

I guess my point is: that library function requires SOME level of compiler 
magic via a builtin/etc... though I guess if we're handling this like a normal 
lowering the library should take care of it?  

I think this works .... but I'll think more on it.  We at one point will 
probably need to make sure that `current_exception` still does the right 
thing/we fit into that, but perhaps thats just a validation step.

https://github.com/llvm/llvm-project/pull/181284
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to