[LLVMdev] x86 unwind support[MESSAGE NOT SCANNED]
Andrew Haley
aph at redhat.com
Mon Jul 20 06:53:14 PDT 2009
Kenneth Uildriks wrote:
>> Let's go back a bit. Your claim is that there is no need to unwind
>> frame-by-frame, an unwind simply needs to make a single jump to an
>> invoke instruction and restore the context (which in x86 is just 6
>> registers). (This is, more or less, what longjmp() does.) Duncan Sands
>> explained to you why that wouldn't work, saying "if you throw an
>> exception using your proposed unwind implementation, then it wouldn't
>> be caught by dwarf catch/cleanup regions".
>>
>> He's right. You can't just jump to the invoke instruction, you must
>> also pop any cleanups. This is nothing to do with C++, and it has
>> nothing to do with whether a language has stack-allocated objects.
>
> But don't all functions that require cleanups issue invokes rather
> than calls?
I don't think so: any function in any language that has pthreads bindings
can call pthread_cleanup_push() .
Andrew.
More information about the llvm-dev
mailing list