r202178 - clang-cl: use -fno-rtti by default
Hans Wennborg
hans at hanshq.net
Tue Feb 25 10:36:22 PST 2014
Author: hans
Date: Tue Feb 25 12:36:22 2014
New Revision: 202178
URL: http://llvm.org/viewvc/llvm-project?rev=202178&view=rev
Log:
clang-cl: use -fno-rtti by default
Generating RTTI in the MS ABI is currently not supported, and the failures
are confusing to users, so let's disable it by default for now.
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=202178&r1=202177&r2=202178&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Feb 25 12:36:22 2014
@@ -4112,6 +4112,10 @@ void Clang::AddClangCLArgs(const ArgList
if (Arg *A = Args.getLastArg(options::OPT_show_includes))
A->render(Args, CmdArgs);
+ // RTTI is currently not supported, so disable it by default.
+ if (!Args.hasArg(options::OPT_frtti, options::OPT_fno_rtti))
+ CmdArgs.push_back("-fno-rtti");
+
const Driver &D = getToolChain().getDriver();
Arg *MostGeneralArg = Args.getLastArg(options::OPT__SLASH_vmg);
Arg *BestCaseArg = Args.getLastArg(options::OPT__SLASH_vmb);
Modified: cfe/trunk/test/Driver/cl-options.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-options.c?rev=202178&r1=202177&r2=202178&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-options.c (original)
+++ cfe/trunk/test/Driver/cl-options.c Tue Feb 25 12:36:22 2014
@@ -250,5 +250,11 @@
// We support -m32 and -m64.
// RUN: %clang_cl /Zs /WX -m32 -m64 -- %s
+// Use -fno-rtti by default.
+// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=NoRTTI %s
+// NoRTTI: "-fno-rtti"
+// RUN: %clang_cl /c /GR -### -- %s 2>&1 | FileCheck -check-prefix=RTTI %s
+// RTTI-NOT: "-fno-rtti"
+
void f() { }
More information about the cfe-commits
mailing list