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.

llvm-svn: 202178
This commit is contained in:
Hans Wennborg 2014-02-25 18:36:22 +00:00
parent b1ae3d4937
commit 7b0dcef072
2 changed files with 10 additions and 0 deletions

View File

@ -4112,6 +4112,10 @@ void Clang::AddClangCLArgs(const ArgList &Args, ArgStringList &CmdArgs) const {
if (Arg *A = Args.getLastArg(options::OPT_show_includes)) if (Arg *A = Args.getLastArg(options::OPT_show_includes))
A->render(Args, CmdArgs); 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(); const Driver &D = getToolChain().getDriver();
Arg *MostGeneralArg = Args.getLastArg(options::OPT__SLASH_vmg); Arg *MostGeneralArg = Args.getLastArg(options::OPT__SLASH_vmg);
Arg *BestCaseArg = Args.getLastArg(options::OPT__SLASH_vmb); Arg *BestCaseArg = Args.getLastArg(options::OPT__SLASH_vmb);

View File

@ -250,5 +250,11 @@
// We support -m32 and -m64. // We support -m32 and -m64.
// RUN: %clang_cl /Zs /WX -m32 -m64 -- %s // 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() { } void f() { }