[clang] e8402d5 - [clang] [MSVC] Enable unwind tables for ARM

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 2 23:45:49 PDT 2022


Author: Martin Storsjö
Date: 2022-06-03T09:32:00+03:00
New Revision: e8402d5de82ace9399498570a6a2d5cf64463af3

URL: https://github.com/llvm/llvm-project/commit/e8402d5de82ace9399498570a6a2d5cf64463af3
DIFF: https://github.com/llvm/llvm-project/commit/e8402d5de82ace9399498570a6a2d5cf64463af3.diff

LOG: [clang] [MSVC] Enable unwind tables for ARM

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

Improve the existing windows-exceptions.cpp testcase to check for
the state of unwind tables on all MSVC architectures.

Differential Revision: https://reviews.llvm.org/D126862

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/MSVC.cpp b/clang/lib/Driver/ToolChains/MSVC.cpp
index 0ba034f4c9a7a..c6e8bd04455e2 100644
--- a/clang/lib/Driver/ToolChains/MSVC.cpp
+++ b/clang/lib/Driver/ToolChains/MSVC.cpp
@@ -449,8 +449,8 @@ 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::arm ||
+         getArch() == llvm::Triple::thumb || getArch() == llvm::Triple::aarch64;
 }
 
 bool MSVCToolChain::isPICDefault() const {

diff  --git a/clang/test/Driver/windows-exceptions.cpp b/clang/test/Driver/windows-exceptions.cpp
index 84f8e2708f8ee..244c3b9479549 100644
--- a/clang/test/Driver/windows-exceptions.cpp
+++ b/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


        


More information about the cfe-commits mailing list