[cfe-commits] r116759 - in /cfe/trunk: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/Tools.cpp
Daniel Dunbar
daniel at zuster.org
Mon Oct 18 15:36:15 PDT 2010
Author: ddunbar
Date: Mon Oct 18 17:36:15 2010
New Revision: 116759
URL: http://llvm.org/viewvc/llvm-project?rev=116759&view=rev
Log:
Driver/IA: Accept and ignore -force_cpusubtype_ALL, as in 'clang -c
-Wa,-force_cpusubtype_ALL t.c'.
- Tweaks -Wa, and -Xassembler handling to only accept an explicit short list of
arguments and give an obvious unsupported error on others.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td?rev=116759&r1=116758&r2=116759&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td Mon Oct 18 17:36:15 2010
@@ -11,6 +11,8 @@
def err_drv_no_such_file : Error<"no such file or directory: '%0'">;
def err_drv_unsupported_opt : Error<"unsupported option '%0'">;
+def err_drv_unsupported_option_argument : Error<
+ "unsupported argument '%1' to option '%0'">;
def err_drv_unknown_stdin_type : Error<
"-E or -x required when input is from standard input">;
def err_drv_unknown_language : Error<"language not recognized: '%0'">;
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=116759&r1=116758&r2=116759&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Oct 18 17:36:15 2010
@@ -762,10 +762,25 @@
!IsOpt))
CmdArgs.push_back("-mrelax-all");
- // When using an integrated assembler, we send -Wa, and -Xassembler options
- // to -cc1.
- Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
- options::OPT_Xassembler);
+ // When using an integrated assembler, translate -Wa, and -Xassembler
+ // options.
+ for (arg_iterator it = Args.filtered_begin(options::OPT_Wa_COMMA,
+ options::OPT_Xassembler),
+ ie = Args.filtered_end(); it != ie; ++it) {
+ const Arg *A = *it;
+ A->claim();
+
+ for (unsigned i = 0, e = A->getNumValues(); i != e; ++i) {
+ llvm::StringRef Value = A->getValue(Args, i);
+
+ if (Value == "-force_cpusubtype_ALL") {
+ // Do nothing, this is the default and we don't support anything else.
+ } else {
+ D.Diag(clang::diag::err_drv_unsupported_option_argument)
+ << A->getOption().getName() << Value;
+ }
+ }
+ }
} else if (isa<PrecompileJobAction>(JA)) {
// Use PCH if the user requested it.
bool UsePCH = D.CCCUsePCH;
More information about the cfe-commits
mailing list