[LLVMdev] Exception Handling Tables Question

Bill Wendling isanbard at gmail.com
Fri Sep 18 16:49:57 PDT 2009


On Sep 17, 2009, at 6:03 PM, Duncan Sands wrote:

>> There's a miscommunication here. :-) The _Unwind_resume call isn't
>> marked with "nounwind", however it's not called through an "invoke"
>> instruction, only a regular "call" instruction. From what I can see,
>> the only reason it falls within a call site in the exception table is
>> because we're generating call sites for areas of code without
>> "invokes".
>
> yes, and that's absolutely the right thing to do!  Due to a strange
> design choice, if a call does *not* have an entry in the call-site
> table, and the call unwinds, then the runtime calls std::terminate.
> All calls that may throw (like _Unwind_Resume!) must have an entry
> in the call-site table.
>
> If I implement my optimization to eliminate these call site
>> entries which don't have "invoke" calls in them, then the
>> _Unwind_resume call won't have an entry into the exception table, and
>> that would be bad.
>
> As explained above, you can only eliminate call-site entries for
> nounwind calls.  Having a call-site entry has nothing to do with
> whether a call is an invoke or not, it is to do with whether the
> call can throw an exception or not.
>
I was imprecise, but yes, I meant to say that we shouldn't have one  
for "nounwind" calls. :-)

-bw




More information about the llvm-dev mailing list