[LLVMdev] More questions on exception handling

Duncan Sands baldrick at free.fr
Mon Dec 29 07:30:10 PST 2008


Hi Talin,

> I've read and re-read the LLVM exception handling doc, and there are a
> number of things that aren't clear to me.

I agree that this document is rather hard to read.  I've committed some
changes to try and answer your questions.

> If I am calling the _Unwind_ functions directly, do I need to use any of the
> llvm.eh.* functions? Can I just use invoke and write my own landing pad?

Currently you need to use llvm.eh.selector (and thus llvm.eh.exception) in
order to specify a personality function.  Try using 0 as the third argument.
I have a plan to eliminate this problem.

> How do you handle throwing an exception with a catch handler in the same
> function? Invoke won't work since it assumes that the exception is being
> thrown in a subroutine.

It is thrown in a subroutine, for example in _Unwind_RaiseException.

Ciao,

Duncan.



More information about the llvm-dev mailing list