This is an archive of the discontinued LLVM Phabricator instance.

[clang] [MSVC] Enable unwind tables for ARM
ClosedPublic

Authored by mstorsjo on Jun 2 2022, 2:32 AM.

Details

Summary

The backend now can generate working unwind information for this
target.

Diff Detail

Event Timeline

mstorsjo created this revision.Jun 2 2022, 2:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2022, 2:32 AM
mstorsjo requested review of this revision.Jun 2 2022, 2:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2022, 2:32 AM
Herald added a subscriber: MaskRay. · View Herald Transcript
MaskRay accepted this revision.Jun 2 2022, 10:29 AM

This needs a test. There is existing testing gap as this change does not break any clang/test/Driver test.

@@ -449,13 +449,15 @@ bool MSVCToolChain::IsUnwindTablesDefault(const ArgList &Args) const {
   // All non-x86_32 Windows targets require unwind tables. However, LLVM
   // doesn't know how to generate them for all targets, so only enable
   // the ones that are actually implemented.
-  return getArch() == llvm::Triple::x86_64 ||
-         getArch() == llvm::Triple::aarch64;
+  //return getArch() == llvm::Triple::x86_64 ||
+  //       getArch() == llvm::Triple::aarch64;
+  return false;
 }

I think you may add windows-gnu RUN lines somewhere (perhaps mingw.cpp) to test both PIC and -funwind-tables= options, then remove windows-gnu RUN lines from pic.c.
(We should strive to use fewer RUN lines to achieve the same coverage.)

This revision is now accepted and ready to land.Jun 2 2022, 10:29 AM
mstorsjo updated this revision to Diff 433836.Jun 2 2022, 12:24 PM

Added testing, including testing for the existing architectures.

There was a good match for testing for this in windows-exceptions.cpp - unfortunately it ends up with 2 more RUN lines, but it fits in so well there so I'd rather not try to place it somewhere else right now.

MaskRay accepted this revision.Jun 2 2022, 12:31 PM

LGTM.

(I still think it helps to drop some RUN lines from pic.c but that change can be separate.)

This revision was landed with ongoing or failed builds.Jun 2 2022, 11:46 PM
This revision was automatically updated to reflect the committed changes.