[LLVMdev] How to code catch-all in the new exception handling scheme?
baldrick at free.fr
Wed Sep 28 02:33:13 CDT 2011
>> The unwinder delegates the decision of whether to stop in a call frame to
>> that call frame's language-specific personality function. Not all personality
>> functions guarantee that they will stop to perform cleanups.
>> This is incorrect: it is not the personality function that makes the decision,
>> it is who-ever is doing the unwinding. For example if you use the Ada "throw"
>> method it will always run all C++ cleanups, even if that's all there is to do.
>> While if you use the C++ throw method it won't bother running Ada cleanups if
>> that is all there is to do. All personality functions that I am familiar with
>> treat cleanups in the same way.
> How does one incorporate their own LLVM backend unwinding mechanism?
> I'm assuming that you have an Ada backend. Does your backend not call
> _Unwind_RaiseException for example?
it does, and follows that call with a call to _Unwind_ForcedUnwind. If only
cleanups are seen up the call stack then the call to _Unwind_RaiseException
returns. The call to _Unwind_ForcedUnwind then runs the cleanups. When (if)
it returns then the program is terminated. C++ skips the call to
_Unwind_ForcedUnwind and just terminates the program at once if
More information about the LLVMdev