[PATCH][X86_64/MC] Towards usable Win64 exception handling

Kai Nacke kai.nacke at redstar.de
Mon Jun 17 03:19:00 PDT 2013


Hi Anton!

On 17.06.2013 09:42, Anton Korobeynikov wrote:
>> - The Dwarf EH code ("gcc_except_table") is no longer emitted into a
>> separate section but into the UNWIND_INFO structure as language specific
>> handler data. A pointer to this data is passed in field
>> DISPATCHER_CONTEXT->HandlerData to the personality function.
> Isn't this something specific to the given personality function?

In theory: yes. MSVC uses different EH handler functions for C and C++ 
which use different handler data structures, too.
But: LLVM supports only Dwarf EH handling. So every personality function 
which is specified in the IR has to deal with the Dwarf EH structures. 
Using the HandlerData field for passing the Dwarf EH structures to the 
personality function is the most convenient way to get access to this data.

This is same as gcc 4.8 does. I haven't checked the output of gcc but if 
you look at libgcc/unwind-seh.c you find the following code:

void *
_Unwind_GetLanguageSpecificData (struct _Unwind_Context *c)
{
   return c->disp->HandlerData;
}

According to this gcc also emits the Dwarf EH code into the UNWIND_INFO 
structure.

Did you look at the other patches, too?

Thanks for your comment.

Regards
Kai



More information about the llvm-commits mailing list