From: Daniel Dunbar Date: Fri, 24 Sep 2010 19:39:37 +0000 (+0000) Subject: Driver: Add -fallow-unsupported which disables some of the eager error'ing we do X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e94db4771856659c12e1f269141cbbc4e55b1c47;p=clang Driver: Add -fallow-unsupported which disables some of the eager error'ing we do to prevent users from trying unsupported stuff. Useful for testing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114749 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 6451e4ce72..95b84d3f70 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -234,6 +234,7 @@ def fPIC : Flag<"-fPIC">, Group; def fPIE : Flag<"-fPIE">, Group; def fno_PIE : Flag<"-fno-PIE">, Group; def faccess_control : Flag<"-faccess-control">, Group; +def fallow_unsupported : Flag<"-fallow-unsupported">, Group; def fapple_kext : Flag<"-fapple-kext">, Group; def fasm : Flag<"-fasm">, Group; def fasm_blocks : Flag<"-fasm-blocks">, Group; diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index b986f7f1c0..ff4af221e3 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -988,19 +988,21 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // Explicitly error on some things we know we don't support and can't just // ignore. types::ID InputType = Inputs[0].getType(); - Arg *Unsupported; - if ((Unsupported = Args.getLastArg(options::OPT_MG)) || - (Unsupported = Args.getLastArg(options::OPT_iframework)) || - (Unsupported = Args.getLastArg(options::OPT_fshort_enums))) - D.Diag(clang::diag::err_drv_clang_unsupported) - << Unsupported->getOption().getName(); - - if (types::isCXX(InputType) && - getToolChain().getTriple().getOS() == llvm::Triple::Darwin && - getToolChain().getTriple().getArch() == llvm::Triple::x86) { - if ((Unsupported = Args.getLastArg(options::OPT_fapple_kext))) - D.Diag(clang::diag::err_drv_clang_unsupported_opt_cxx_darwin_i386) + if (!Args.hasArg(options::OPT_fallow_unsupported)) { + Arg *Unsupported; + if ((Unsupported = Args.getLastArg(options::OPT_MG)) || + (Unsupported = Args.getLastArg(options::OPT_iframework)) || + (Unsupported = Args.getLastArg(options::OPT_fshort_enums))) + D.Diag(clang::diag::err_drv_clang_unsupported) << Unsupported->getOption().getName(); + + if (types::isCXX(InputType) && + getToolChain().getTriple().getOS() == llvm::Triple::Darwin && + getToolChain().getTriple().getArch() == llvm::Triple::x86) { + if ((Unsupported = Args.getLastArg(options::OPT_fapple_kext))) + D.Diag(clang::diag::err_drv_clang_unsupported_opt_cxx_darwin_i386) + << Unsupported->getOption().getName(); + } } Args.AddAllArgs(CmdArgs, options::OPT_v);