r334145 - [Driver] Stop passing -fseh-exceptions for x86_64-windows-msvc

Shoaib Meenai via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 6 16:09:02 PDT 2018


Author: smeenai
Date: Wed Jun  6 16:09:02 2018
New Revision: 334145

URL: http://llvm.org/viewvc/llvm-project?rev=334145&view=rev
Log:
[Driver] Stop passing -fseh-exceptions for x86_64-windows-msvc

-fseh-exceptions is only meaningful for MinGW targets, and that driver
already has logic to pass either -fdwarf-exceptions or -fseh-exceptions
as appropriate. -fseh-exceptions is just a no-op for MSVC triples, and
passing it to cc1 causes unnecessary confusion.

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

Added:
    cfe/trunk/test/Driver/windows-exceptions.cpp
Modified:
    cfe/trunk/lib/Driver/ToolChain.cpp

Modified: cfe/trunk/lib/Driver/ToolChain.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChain.cpp?rev=334145&r1=334144&r2=334145&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChain.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChain.cpp Wed Jun  6 16:09:02 2018
@@ -471,8 +471,6 @@ ObjCRuntime ToolChain::getDefaultObjCRun
 
 llvm::ExceptionHandling
 ToolChain::GetExceptionModel(const llvm::opt::ArgList &Args) const {
-  if (Triple.isOSWindows() && Triple.getArch() != llvm::Triple::x86)
-    return llvm::ExceptionHandling::WinEH;
   return llvm::ExceptionHandling::None;
 }
 

Added: cfe/trunk/test/Driver/windows-exceptions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/windows-exceptions.cpp?rev=334145&view=auto
==============================================================================
--- cfe/trunk/test/Driver/windows-exceptions.cpp (added)
+++ cfe/trunk/test/Driver/windows-exceptions.cpp Wed Jun  6 16:09:02 2018
@@ -0,0 +1,9 @@
+// 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-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
+
+MSVC-NOT: -fdwarf-exceptions
+MSVC-NOT: -fseh-exceptions
+MINGW-DWARF: -fdwarf-exceptions
+MINGW-SEH: -fseh-exceptions




More information about the cfe-commits mailing list