Make llvm.eh.begincatch use an outparam
Ultimately, __CxxFrameHandler3 needs us to put a stack offset in a
table, and it will take responsibility for copying the exception object
into that slot. Modelling the exception object as an SSA value returned
by begincatch isn't going to work in general, so make it use an output
parameter.
Reviewers: andrew.w.kaylor
Differential Revision: http://reviews.llvm.org/D7920
llvm-svn: 231086
diff --git a/llvm/docs/ExceptionHandling.rst b/llvm/docs/ExceptionHandling.rst
index 696b50f..bf93fda 100644
--- a/llvm/docs/ExceptionHandling.rst
+++ b/llvm/docs/ExceptionHandling.rst
@@ -442,7 +442,7 @@
.. code-block:: llvm
- i8* @llvm.eh.begincatch(i8* %exn)
+ void @llvm.eh.begincatch(i8* %ehptr, i8* %ehobj)
This intrinsic marks the beginning of catch handling code within the blocks
@@ -450,11 +450,11 @@
depends on the compilation target and the personality function associated
with the ``landingpad`` instruction.
-The argument to this intrinsic is a pointer that was previously extracted from
-the aggregate return value of the ``landingpad`` instruction. The return
-value of the intrinsic is a pointer to the exception object to be used by the
-catch code. This pointer is returned as an ``i8*`` value, but the actual type
-of the object will depend on the exception that was thrown.
+The first argument to this intrinsic is a pointer that was previously extracted
+from the aggregate return value of the ``landingpad`` instruction. The second
+argument to the intrinsic is a pointer to stack space where the exception object
+should be stored. The runtime handles the details of copying the exception
+object into the slot. If the second parameter is null, no copy occurs.
Uses of this intrinsic are generated by the C++ front-end. Many targets will
use implementation-specific functions (such as ``__cxa_begin_catch``) instead