[PATCH] D126862: [clang] [MSVC] Enable unwind tables for ARM

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 2 12:24:21 PDT 2022


mstorsjo updated this revision to Diff 433836.
mstorsjo added a comment.

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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126862/new/

https://reviews.llvm.org/D126862

Files:
  clang/lib/Driver/ToolChains/MSVC.cpp
  clang/test/Driver/windows-exceptions.cpp


Index: clang/test/Driver/windows-exceptions.cpp
===================================================================
--- clang/test/Driver/windows-exceptions.cpp
+++ clang/test/Driver/windows-exceptions.cpp
@@ -1,5 +1,7 @@
-// RUN: %clang -target i686-windows-msvc -c %s -### 2>&1 | FileCheck -check-prefix=MSVC %s
-// RUN: %clang -target x86_64-windows-msvc -c %s -### 2>&1 | FileCheck -check-prefix=MSVC %s
+// RUN: %clang -target i686-windows-msvc -c %s -### 2>&1 | FileCheck -check-prefix=MSVC -check-prefix=MSVC-NOSEH %s
+// RUN: %clang -target x86_64-windows-msvc -c %s -### 2>&1 | FileCheck -check-prefix=MSVC -check-prefix=MSVC-SEH %s
+// RUN: %clang -target armv7-windows-msvc -c %s -### 2>&1 | FileCheck -check-prefix=MSVC -check-prefix=MSVC-SEH %s
+// RUN: %clang -target aarch64-windows-msvc -c %s -### 2>&1 | FileCheck -check-prefix=MSVC -check-prefix=MSVC-SEH %s
 // RUN: %clang -target i686-windows-gnu -c %s -### 2>&1 | FileCheck -check-prefix=MINGW-DWARF %s
 // RUN: %clang -target x86_64-windows-gnu -c %s -### 2>&1 | FileCheck -check-prefix=MINGW-SEH %s
 // RUN: %clang -target aarch64-windows-gnu -fdwarf-exceptions -c %s -### 2>&1 | FileCheck -check-prefix=MINGW-DWARF %s
@@ -7,6 +9,8 @@
 
 MSVC-NOT: -exception-model=dwarf
 MSVC-NOT: -exception-model=seh
+MSVC-NOSEH-NOT: -funwind-tables=2
+MSVC-SEH: -funwind-tables=2
 MINGW-DWARF: -exception-model=dwarf
 MINGW-SEH: -funwind-tables=2
 MINGW-SEH: -exception-model=seh
Index: clang/lib/Driver/ToolChains/MSVC.cpp
===================================================================
--- clang/lib/Driver/ToolChains/MSVC.cpp
+++ clang/lib/Driver/ToolChains/MSVC.cpp
@@ -449,8 +449,8 @@
   // 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::arm ||
+         getArch() == llvm::Triple::thumb || getArch() == llvm::Triple::aarch64;
 }
 
 bool MSVCToolChain::isPICDefault() const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126862.433836.patch
Type: text/x-patch
Size: 2151 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220602/b20fc8a1/attachment.bin>


More information about the cfe-commits mailing list