Skip to content

Commit

Permalink
[MinGW] Use SEH by default on AArch64
Browse files Browse the repository at this point in the history
The implementation of SEH is pretty mature at this point.

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

llvm-svn: 360081
  • Loading branch information
mstorsjo authored and MrSidims committed May 17, 2019
1 parent 62c8e9c commit c8eabf7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions clang/lib/Driver/ToolChains/MinGW.cpp
Expand Up @@ -436,7 +436,8 @@ bool toolchains::MinGW::IsUnwindTablesDefault(const ArgList &Args) const {
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 {
Expand All @@ -451,7 +452,7 @@ bool toolchains::MinGW::isPICDefaultForced() const {

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;
}
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Driver/windows-exceptions.cpp
Expand Up @@ -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
Expand Down

0 comments on commit c8eabf7

Please sign in to comment.