[LLVMdev] About unwind...
baldrick at free.fr
Sun Dec 16 07:57:33 PST 2007
> 2) When I unwind, the stack gets popped but it would make sense to pass some
> data to the exception handler. I guess I could use a global variable for
> this, but is there a way to do it on the stack? (Wouldn't that make more
> sense also?)
Passing extra info on the stack doesn't make much sense because the stack
Also, note that the unwind instruction is currently turned into an abort
call at codegen time!
I suggest you compile some C++ code with exception handling using
llvm-g++ -S -emit-llvm and see how it does it. In short: throwing
an exception is done by a library call which takes an exception object.
Catching is done using the LLVM invoke instruction. The exception
object is retrieved by an llvm.eh.exception intrinsic call. See
More information about the llvm-dev