This is an archive of the discontinued LLVM Phabricator instance.

[libunwind][include] Add SEH declarations to <unwind.h>.
ClosedPublic

Authored by cdavis5x on Aug 7 2018, 3:53 PM.

Details

Summary

Make the _Unwind_Exception struct correct under SEH. Add a
declaration of _GCC_specific_handler(), which is used by SEH versions
of Itanium personality handlers to do common setup. Roughly corresponds
to Clang's D50380.

Event Timeline

cdavis5x created this revision.Aug 7 2018, 3:53 PM

Should we maybe add the same declaration of _GCC_specific_handler to clang's unwind.h? That would allow removing the forward declaration in libcxxabi from D49638.

Do you plan on implementing these SEH specific bits in libunwind, or are you just trying to sync things?

include/unwind.h
383

I think __x86_64__ is the wrong condition here. DISPATCHER_CONTEXT is defined on ARM and ARM64 as well (and probably other obscure cases like IA-64), so I would rather make this #ifndef __i386__ instead, or explicitly listing __x86_64__, __arm__ and __aarch64__.

On the other hand, we don't really ever build code with __SEH__ defined for i386 here either, so we could also just leave it out - I see that GCC's unwind.h does that.

Should we maybe add the same declaration of _GCC_specific_handler to clang's unwind.h? That would allow removing the forward declaration in libcxxabi from D49638.

Probably. I believe it's present in GCC's <unwind.h>, too.

Do you plan on implementing these SEH specific bits in libunwind,

Already have. Patch forthcoming.

cdavis5x updated this revision to Diff 159722.Aug 8 2018, 7:52 AM
  • Remove unneeded preprocessor condition.
cdavis5x marked an inline comment as done.Aug 8 2018, 7:53 AM
mstorsjo accepted this revision.Aug 8 2018, 8:13 AM

Do you plan on implementing these SEH specific bits in libunwind,

Already have. Patch forthcoming.

Oh, excellent - looking forward to it.

This version LGTM.

This revision is now accepted and ready to land.Aug 8 2018, 8:13 AM
This revision was automatically updated to reflect the committed changes.