exception handling and fastcc

Hello,

I am writing a compiler for a functional language and am using the fastcc calling convention extensibly. I am now thinking about how to implement exception handling (about which I know close to nothing) and was hoping to use the support for exception handling built-in llvm.

Question: can I use the standard __cxa_throw (and personality function) from C++ and the llvm eh machinery even if I am using fastcc instead of the standard calling convention ?

Thanks,

Kind regards
Nicolas

Yep. I’m pretty sure that will work.

If your exception handling scheme can be described as a class hierarchy, then yes, you can build your own Itanium C++ RTTI tables and pass it to __cxa_throw. If the mapping is too hard, you will have to implement your own EH personality to use in place of __gxx_personality_v0.