[PATCH] D61591: [MinGW] Use SEH by default on AArch64

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 6 06:11:41 PDT 2019


mstorsjo created this revision.
mstorsjo added reviewers: rnk, efriedma, mgrang, ssijaric.
Herald added subscribers: kristof.beyls, javed.absar.
Herald added a project: clang.

The implementation of SEH is pretty mature at this point.


Repository:
  rC Clang

https://reviews.llvm.org/D61591

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


Index: test/Driver/windows-exceptions.cpp
===================================================================
--- test/Driver/windows-exceptions.cpp
+++ test/Driver/windows-exceptions.cpp
@@ -2,8 +2,8 @@
 // RUN: %clang -target x86_64-windows-msvc -c %s -### 2>&1 | FileCheck -check-prefix=MSVC %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 -c %s -### 2>&1 | FileCheck -check-prefix=MINGW-DWARF %s
-// RUN: %clang -target aarch64-windows-gnu -fseh-exceptions -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
 
 MSVC-NOT: -fdwarf-exceptions
 MSVC-NOT: -fseh-exceptions
Index: lib/Driver/ToolChains/MinGW.cpp
===================================================================
--- lib/Driver/ToolChains/MinGW.cpp
+++ lib/Driver/ToolChains/MinGW.cpp
@@ -442,7 +442,8 @@
   if (ExceptionArg &&
       ExceptionArg->getOption().matches(options::OPT_fseh_exceptions))
     return true;
-  return getArch() == llvm::Triple::x86_64;
+  return getArch() == llvm::Triple::x86_64 ||
+         getArch() == llvm::Triple::aarch64;
 }
 
 bool toolchains::MinGW::isPICDefault() const {
@@ -457,7 +458,7 @@
 
 llvm::ExceptionHandling
 toolchains::MinGW::GetExceptionModel(const ArgList &Args) const {
-  if (getArch() == llvm::Triple::x86_64)
+  if (getArch() == llvm::Triple::x86_64 || getArch() == llvm::Triple::aarch64)
     return llvm::ExceptionHandling::WinEH;
   return llvm::ExceptionHandling::DwarfCFI;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61591.198256.patch
Type: text/x-patch
Size: 1821 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190506/d7159c15/attachment-0001.bin>


More information about the cfe-commits mailing list