[LLVMdev] Catching C++ exceptions, cleaning up, rethrowing

Bill Wendling wendling at apple.com
Sun Apr 8 04:20:54 PDT 2012


On Apr 4, 2012, at 9:32 PM, Paul J. Lucas wrote:

> On Mar 23, 2012, at 4:46 PM, Bill Wendling wrote:

[...]

> This all seems to work just fine.  I can throw a C++ exception either in a C++ object's constructor or in an ordinary member function and the stack unwinds correctly (the object's destructors are called) and the exception is propagated back up the C++ code that called the JIT'd code.
> 
> So is this the right way to do this?  Am I missing anything?
> 
Hi Paul,

This looks like roughly what I would expect the code to be. I'd have to see the LLVM IR it generated to be sure. But it looks okay to me. (And if it's working for you, all the better. ;-) )

-bw





More information about the llvm-dev mailing list