x86-64 unwind additions

Hi all,

We're at the point in our port of OpenVMS to x86-64 that we're working
on the unwind code. The current ABI and the current codebase doesn't
have enough support for true asynchronous unwinding from any point (most
notably in the prologue/epilogue) in the code that OpenVMS needs. We're
working on a set of changes to the compact unwind information to handle
the additional cases (and some clearly OpenVMS-specific needs that
others won't care about).

We've noted that gcc seems to generate better asynchronous unwind info
and has the companion -fasynchronous-unwind-tables. clang just maps it
to -funwind-tables.

We've also noted that Reid and company have nicely added
Analysis/EHPersonalities.h along with a "isAsynchronousEHPersonality"
function for MSVC personality routines.

I'll post an RFC in January to get some feedback, but wanted to know if
others have out-of-tree unwind changes in this area. Perhaps they might
be helpful to us.

John

Personally, I support the goal of emitting DWARF CFI that is correct at every instruction. Recently there was work on emitting accurate CFI for epilogues, but it had to be reverted due to some conflicts with MachO compact CFI. Eventually, our DWARF CFI should probably look more like the .seh_pushreg instructions we emit for win64.

I think “isAsynchronousEHPersonality” has a different meaning than what you have in mind, and should be renamed. A better name might be “mayCatchNonCallExceptions”.

The referenced commit and discussion thread was:
r317579 - Reland “Correct dwarf unwind information in function epilogue for X86” (November 7, last updated last week)