[PATCH] D126871: [clang] [MinGW] Use SEH for unwind info on ARM by default

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 6 13:28:34 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGfcb784db4961: [clang] [MinGW] Default to WinEH (SEH) exception handling instead of Dwarf (authored by mstorsjo).

Changed prior to commit:
  https://reviews.llvm.org/D126871?vs=433706&id=434589#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126871

Files:
  clang/lib/Driver/ToolChains/MinGW.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
@@ -4,6 +4,8 @@
 // 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 armv7-windows-gnu -fdwarf-exceptions -c %s -### 2>&1 | FileCheck -check-prefix=MINGW-DWARF %s
+// RUN: %clang -target armv7-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
 // RUN: %clang -target aarch64-windows-gnu -c %s -### 2>&1 | FileCheck -check-prefix=MINGW-SEH %s
 
Index: clang/lib/Driver/ToolChains/MinGW.cpp
===================================================================
--- clang/lib/Driver/ToolChains/MinGW.cpp
+++ clang/lib/Driver/ToolChains/MinGW.cpp
@@ -478,8 +478,8 @@
   if (ExceptionArg &&
       ExceptionArg->getOption().matches(options::OPT_fseh_exceptions))
     return true;
-  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 toolchains::MinGW::isPICDefault() const {
@@ -495,7 +495,8 @@
 
 llvm::ExceptionHandling
 toolchains::MinGW::GetExceptionModel(const ArgList &Args) const {
-  if (getArch() == llvm::Triple::x86_64 || getArch() == llvm::Triple::aarch64)
+  if (getArch() == llvm::Triple::x86_64 || getArch() == llvm::Triple::aarch64 ||
+      getArch() == llvm::Triple::arm || getArch() == llvm::Triple::thumb)
     return llvm::ExceptionHandling::WinEH;
   return llvm::ExceptionHandling::DwarfCFI;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126871.434589.patch
Type: text/x-patch
Size: 2054 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220606/c2030910/attachment-0001.bin>


More information about the cfe-commits mailing list