Author: majnemer Date: Mon Feb 22 11:44:51 2016 New Revision: 261537 URL: http://llvm.org/viewvc/llvm-project?rev=261537&view=rev Log: Don't enable /GX by default
The /GX flag is disabled unless explicitly specified on the command line. This partially addresses PR26698. Modified: cfe/trunk/lib/Driver/Tools.cpp cfe/trunk/test/Driver/cl-options.c Modified: cfe/trunk/lib/Driver/Tools.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=261537&r1=261536&r2=261537&view=diff ============================================================================== --- cfe/trunk/lib/Driver/Tools.cpp (original) +++ cfe/trunk/lib/Driver/Tools.cpp Mon Feb 22 11:44:51 2016 @@ -5813,8 +5813,10 @@ static EHFlags parseClangCLEHFlags(const } } // 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; } Modified: cfe/trunk/test/Driver/cl-options.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-options.c?rev=261537&r1=261536&r2=261537&view=diff ============================================================================== --- cfe/trunk/test/Driver/cl-options.c (original) +++ cfe/trunk/test/Driver/cl-options.c Mon Feb 22 11:44:51 2016 @@ -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" _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits