SjLj based exception handling unwinding support. This patch is nasty, brutish

and short. Well, it's kinda short. Definitely nasty and brutish.

The front-end generates the register/unregister calls into the SjLj runtime,
call-site indices and landing pad dispatch. The back end fills in the LSDA
with the call-site information provided by the front end. Catch blocks are
not yet implemented.

Built on Darwin and verified no llvm-core "make check" regressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78625 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach
2009-08-11 00:09:57 +00:00
parent 3a1f0f6785
commit 1b747ad8a0
25 changed files with 332 additions and 79 deletions

View File

@@ -33,6 +33,8 @@
<li><a href="#llvm_eh_typeid_for"><tt>llvm.eh.typeid.for</tt></a></li>
<li><a href="#llvm_eh_sjlj_setjmp"><tt>llvm.eh.sjlj.setjmp</tt></a></li>
<li><a href="#llvm_eh_sjlj_longjmp"><tt>llvm.eh.sjlj.longjmp</tt></a></li>
<li><a href="#llvm_eh_sjlj_lsda"><tt>llvm.eh.sjlj.lsda</tt></a></li>
<li><a href="#llvm_eh_sjlj_callsite"><tt>llvm.eh.sjlj.callsite</tt></a></li>
</ol></li>
<li><a href="#asm">Asm Table Formats</a>
<ol>
@@ -414,7 +416,7 @@ a reference to a type info.</p>
<p>The SJLJ exception handling uses this intrinsic to force register saving
for the current function and to store the address of the following instruction
for use as a destination address by <a href="#llvm_eh_sjlj_setjmp">
for use as a destination address by <a href="#llvm_eh_sjlj_longjmp">
<tt>llvm.eh.sjlj.longjmp</tt></a>. The buffer format and the overall functioning
of this intrinsic is compatible with the GCC <tt>__builtin_setjmp</tt>
implementation, allowing code built with the two compilers to interoperate.</p>
@@ -428,6 +430,41 @@ are available for use in a target-specific manner.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsubsection">
<a name="llvm_eh_sjlj_lsda">llvm.eh.sjlj.lsda</a>
</div>
<div class="doc_text">
<pre>
i8* %<a href="#llvm_eh_sjlj_lsda">llvm.eh.sjlj.lsda</a>( )
</pre>
<p>Used for SJLJ based exception handling, the <a href="#llvm_eh_sjlj_lsda">
<tt>llvm.eh.sjlj.lsda</tt></a> intrinsic returns the address of the Language
Specific Data Area (LSDA) for the current function. The SJLJ front-end code
stores this address in the exception handling function context for use by
the runtime.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsubsection">
<a name="llvm_eh_sjlj_callsite">llvm.eh.sjlj.callsite</a>
</div>
<div class="doc_text">
<pre>
void %<a href="#llvm_eh_sjlj_callsite">llvm.eh.sjlj.callsite</a>(i32)
</pre>
<p>The SJLJ front-end allocates call site indices for invoke instrucitons.
These values are passed to the back-end via the
<a href="#llvm_eh_sjlj_callsite"><tt>llvm.eh.sjlj.callsite</tt></a>
intrinsic, where they are used to build the LSDA call-site table.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_section">
<a name="asm">Asm Table Formats</a>