Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clang-cl: Map /EHs- to -fno-exceptions
This isn't 100% compatible with MSVC, but it's close enough. MSVC's /EH flag doesn't really control exceptions so much as how to clean up after an exception is thrown. The upshot is that cl.exe /EHs- will compile try, throw, and catch statements with a warning, but clang-cl will reject such constructs with a hard error. We can't compile such EH constructs anyway, but this may matter to consumers of the AST. Reviewers: hans Differential Revision: http://reviews.llvm.org/D4317 llvm-svn: 211909
- Loading branch information
Showing
4 changed files
with
80 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Don't attempt slash switches on msys bash. | ||
// REQUIRES: shell-preserves-root | ||
|
||
// Note: %s must be preceded by --, otherwise it may be interpreted as a | ||
// command-line option, e.g. on Mac where %s is commonly under /Users. | ||
|
||
// RUN: %clang_cl /c /EHsc -### -- %s 2>&1 | FileCheck -check-prefix=EHsc %s | ||
// EHsc: "-fexceptions" | ||
|
||
// RUN: %clang_cl /c /EHs-c- -### -- %s 2>&1 | FileCheck -check-prefix=EHs_c_ %s | ||
// EHs_c_-NOT: "-fexceptions" | ||
|
||
// RUN: %clang_cl /c /EHs- /EHc- -### -- %s 2>&1 | FileCheck -check-prefix=EHs_EHc_ %s | ||
// EHs_EHc_-NOT: "-fexceptions" | ||
|
||
// RUN: %clang_cl /c /EHs- /EHs -### -- %s 2>&1 | FileCheck -check-prefix=EHs_EHs %s | ||
// EHs_EHs: "-fexceptions" | ||
|
||
// RUN: %clang_cl /c /EHs- /EHsa -### -- %s 2>&1 | FileCheck -check-prefix=EHs_EHa %s | ||
// EHs_EHa: "-fexceptions" | ||
|
||
// RUN: %clang_cl /c /EHinvalid -### -- %s 2>&1 | FileCheck -check-prefix=EHinvalid %s | ||
// EHinvalid: error: invalid value 'invalid' in '/EH' | ||
// EHinvalid-NOT: error: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters