This is an archive of the discontinued LLVM Phabricator instance.

[MS ABI] Hook clang up to the new EH instructions
ClosedPublic

Authored by majnemer on Jul 22 2015, 12:39 AM.

Details

Summary

The new EH instructions make it possible for LLVM to generate .xdata
tables that the MSVC personality routines will be happy about. Because
this is experimental, hide it behind a -cc1 flag (-fnew-ms-eh).

Diff Detail

Repository
rL LLVM

Event Timeline

majnemer updated this revision to Diff 30326.Jul 22 2015, 12:39 AM
majnemer retitled this revision from to [MS ABI] Hook clang up to the new EH instructions.
majnemer updated this object.
majnemer added a reviewer: rnk.
majnemer added a subscriber: cfe-commits.
rnk added inline comments.Jul 22 2015, 10:07 AM
include/clang/Basic/LangOptions.def
111 ↗(On Diff #30326)

Seems like it should be a CodeGenOption.

lib/CodeGen/CGCleanup.cpp
907 ↗(On Diff #30326)

Should we do anything to synchronize these getCXXABI checks with the EHPersonality? At the very least, I think it's more intuitive to the reader to make the decisions about the IR we use to be based on the personality.

Probably the right thing to do here is to declare EHPersonality in CGCleanup.h, and then acknowledge that CGCleanup.h is actually CGException.h. Sounds like a separable patch.

lib/CodeGen/CGException.cpp
897 ↗(On Diff #30326)

Should we rename the locals here according to the prevailing LLVM style?

911 ↗(On Diff #30326)

Drop the extra parens?

944 ↗(On Diff #30326)

Please add a comment documenting what the return value is. I'm thinking:

If the catchblock instructions are used for EH dispatch, then the basic block holding the final catchendblock instruction is returned.
majnemer updated this revision to Diff 30421.Jul 22 2015, 4:13 PM
  • Address Reid's review comments
majnemer updated this revision to Diff 30429.Jul 22 2015, 4:54 PM
  • Address Reid's review comments
  • Use EHPersonality instead of the CXXABI.
rnk accepted this revision.Jul 23 2015, 1:47 PM
rnk edited edge metadata.

lgtm, but we need the LLVM side first obviously.

This revision is now accepted and ready to land.Jul 23 2015, 1:47 PM
This revision was automatically updated to reflect the committed changes.