r262197 - [clang-cl] /EHc should not have an effect on /EHa
David Majnemer via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 28 17:40:31 PST 2016
Author: majnemer
Date: Sun Feb 28 19:40:30 2016
New Revision: 262197
URL: http://llvm.org/viewvc/llvm-project?rev=262197&view=rev
Log:
[clang-cl] /EHc should not have an effect on /EHa
This matches behavior with MSVC.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/cl-eh.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=262197&r1=262196&r2=262197&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sun Feb 28 19:40:30 2016
@@ -5829,12 +5829,16 @@ static EHFlags parseClangCLEHFlags(const
switch (EHVal[I]) {
case 'a':
EH.Asynch = maybeConsumeDash(EHVal, I);
+ if (EH.Asynch)
+ EH.Synch = false;
continue;
case 'c':
EH.NoUnwindC = maybeConsumeDash(EHVal, I);
continue;
case 's':
EH.Synch = maybeConsumeDash(EHVal, I);
+ if (EH.Synch)
+ EH.Asynch = false;
continue;
default:
break;
@@ -5932,7 +5936,7 @@ void Clang::AddClangCLArgs(const ArgList
if (EH.Synch || EH.Asynch) {
CmdArgs.push_back("-fcxx-exceptions");
CmdArgs.push_back("-fexceptions");
- if (EH.NoUnwindC)
+ if (EH.Synch && EH.NoUnwindC)
CmdArgs.push_back("-fexternc-nounwind");
}
Modified: cfe/trunk/test/Driver/cl-eh.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-eh.cpp?rev=262197&r1=262196&r2=262197&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-eh.cpp (original)
+++ cfe/trunk/test/Driver/cl-eh.cpp Sun Feb 28 19:40:30 2016
@@ -21,6 +21,11 @@
// EHs_EHa: "-fcxx-exceptions"
// EHs_EHa: "-fexceptions"
+// RUN: %clang_cl /c /EHa /EHc -### -- %s 2>&1 | FileCheck -check-prefix=EHa_EHc %s
+// EHa_EHc: "-fcxx-exceptions"
+// EHa_EHc: "-fexceptions"
+// EHa_EHc-NOT: "-fexternc-nounwind"
+
// RUN: %clang_cl /c /EHinvalid -### -- %s 2>&1 | FileCheck -check-prefix=EHinvalid %s
// EHinvalid: error: invalid value 'invalid' in '/EH'
// EHinvalid-NOT: error:
More information about the cfe-commits
mailing list