[LLVMdev] unwind/invoke design

Török Edwin edwintorok at gmail.com
Mon Jun 15 10:42:01 PDT 2009


On 2009-06-15 20:26, Wesley W. Terpstra wrote:
> On Mon, Jun 15, 2009 at 7:08 PM, Aaron
> Gray<aaronngray.lists at googlemail.com> wrote:
>   
>>> The documentation of unwind/invoke is quite clear and does exactly
>>> what I need: unwinding the stack. I don't need it to carry an object
>>> back. I don't need it to figure out what the type of the object is or
>>> what catch() blocks it matches. I just need it to unwind the stack.
>>> The rest is my job as a part of the runtime. Unfortunately, I have
>>> learned that while this works with the bytecode evaluator, it doesn't
>>> work with the JIT or native codegen [1].
>>>       
>> DWARF EH maybe what you want, it has zero overhead on normal calls and I
>> believe it is built into LLVM's assemblers. A DWARF style EH is also built
>> into the JIT too.
>>     
>
> How do I tell llc to output dwarf-style 'unwnd' ? Both -enable-eh and
> -enable-correct-eh-support compile 'unwind' to nothing on x86 with llc
> v2.5.
>   

Write some C++ code into llvm.org/demo, and watch the output assembly,
for example:
int foo() {
 throw 1;
}

int bar() {
try {
  foo();
} catch (...) {
}
}

That should show the basics of exception handling.

Best regards,
--Edwin



More information about the llvm-dev mailing list