Don't enable /GX by default

The /GX flag is disabled unless explicitly specified on the command
line.  This partially addresses PR26698.

llvm-svn: 261537
This commit is contained in:
David Majnemer 2016-02-22 17:44:51 +00:00
parent 933d8db922
commit a7bdc5ad54
2 changed files with 6 additions and 1 deletions

View File

@ -5813,8 +5813,10 @@ static EHFlags parseClangCLEHFlags(const Driver &D, const ArgList &Args) {
}
}
// The /GX, /GX- flags are only processed if there are not /EH flags.
// The default is that /GX is not specified.
if (EHArgs.empty() &&
Args.hasFlag(options::OPT__SLASH_GX, options::OPT__SLASH_GX_)) {
Args.hasFlag(options::OPT__SLASH_GX, options::OPT__SLASH_GX_,
/*default=*/false)) {
EH.Synch = true;
EH.NoUnwindC = true;
}

View File

@ -211,6 +211,9 @@
// RUN: %clang_cl /FI asdf.h -### -- %s 2>&1 | FileCheck -check-prefix=FI_ %s
// FI_: "-include" "asdf.h"
// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=NO-GX %s
// NO-GX-NOT: "-fcxx-exceptions" "-fexceptions"
// RUN: %clang_cl /c /GX -### -- %s 2>&1 | FileCheck -check-prefix=GX %s
// GX: "-fcxx-exceptions" "-fexceptions"