diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -117,8 +117,8 @@ "argument to '%0' is missing (expected %1 value%s1)">; def err_drv_invalid_Xarch_argument_with_args : Error< "invalid Xarch argument: '%0', options requiring arguments are unsupported">; -def err_drv_invalid_Xarch_argument_isdriver : Error< - "invalid Xarch argument: '%0', cannot change driver behavior inside Xarch argument">; +def err_drv_invalid_Xarch_argument_unsupported : Error< + "invalid Xarch argument: '%0', not all driver options can be forwared via Xarch argument">; def err_drv_Xopenmp_target_missing_triple : Error< "cannot deduce implicit triple value for -Xopenmp-target, specify triple using -Xopenmp-target=">; def err_drv_invalid_Xopenmp_target_with_args : Error< diff --git a/clang/include/clang/Driver/Options.h b/clang/include/clang/Driver/Options.h --- a/clang/include/clang/Driver/Options.h +++ b/clang/include/clang/Driver/Options.h @@ -24,7 +24,7 @@ /// Flags specifically for clang options. Must not overlap with /// llvm::opt::DriverFlag. enum ClangFlags { - DriverOption = (1 << 4), + NoXarchOption = (1 << 4), LinkerInput = (1 << 5), NoArgumentUnused = (1 << 6), Unsupported = (1 << 7), diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -16,9 +16,9 @@ ///////// // Flags -// DriverOption - The option is a "driver" option, and should not be forwarded -// to other tools. -def DriverOption : OptionFlag; +// The option is a "driver"-only option, and should not be forwarded to other +// tools via `-Xarch` options. +def NoXarchOption : OptionFlag; // LinkerInput - The option is a linker input. def LinkerInput : OptionFlag; @@ -290,19 +290,19 @@ Group, HelpText<"DEBUG/DEVELOPMENT OPTIONS">; class InternalDriverOpt : Group, - Flags<[DriverOption, HelpHidden]>; + Flags<[NoXarchOption, HelpHidden]>; def driver_mode : Joined<["--"], "driver-mode=">, Group, - Flags<[CoreOption, DriverOption, HelpHidden]>, + Flags<[CoreOption, NoXarchOption, HelpHidden]>, HelpText<"Set the driver mode to either 'gcc', 'g++', 'cpp', or 'cl'">; def rsp_quoting : Joined<["--"], "rsp-quoting=">, Group, - Flags<[CoreOption, DriverOption, HelpHidden]>, + Flags<[CoreOption, NoXarchOption, HelpHidden]>, HelpText<"Set the rsp quoting to either 'posix', or 'windows'">; def ccc_gcc_name : Separate<["-"], "ccc-gcc-name">, InternalDriverOpt, HelpText<"Name for native GCC compiler">, MetaVarName<"">; class InternalDebugOpt : Group, - Flags<[DriverOption, HelpHidden, CoreOption]>; + Flags<[NoXarchOption, HelpHidden, CoreOption]>; def ccc_install_dir : Separate<["-"], "ccc-install-dir">, InternalDebugOpt, HelpText<"Simulate installation in the given directory">; def ccc_print_phases : Flag<["-"], "ccc-print-phases">, InternalDebugOpt, @@ -326,7 +326,7 @@ def gen_cdb_fragment_path: Separate<["-"], "gen-cdb-fragment-path">, InternalDebugOpt, HelpText<"Emit a compilation database fragment to the specified directory">; -def _migrate : Flag<["--"], "migrate">, Flags<[DriverOption]>, +def _migrate : Flag<["--"], "migrate">, Flags<[NoXarchOption]>, HelpText<"Run the migrator">; def ccc_objcmt_migrate : Separate<["-"], "ccc-objcmt-migrate">, InternalDriverOpt, @@ -373,10 +373,10 @@ // Standard Options -def _HASH_HASH_HASH : Flag<["-"], "###">, Flags<[DriverOption, CoreOption]>, +def _HASH_HASH_HASH : Flag<["-"], "###">, Flags<[NoXarchOption, CoreOption]>, HelpText<"Print (but do not run) the commands to run for this compilation">; def _DASH_DASH : Option<["--"], "", KIND_REMAINING_ARGS>, - Flags<[DriverOption, CoreOption]>; + Flags<[NoXarchOption, CoreOption]>; def A : JoinedOrSeparate<["-"], "A">, Flags<[RenderJoined]>, Group; def B : JoinedOrSeparate<["-"], "B">, MetaVarName<"">, HelpText<"Add to search path for binaries and object files used implicitly">; @@ -387,14 +387,14 @@ def D : JoinedOrSeparate<["-"], "D">, Group, Flags<[CC1Option]>, MetaVarName<"=">, HelpText<"Define to (or 1 if omitted)">; -def E : Flag<["-"], "E">, Flags<[DriverOption,CC1Option]>, Group, +def E : Flag<["-"], "E">, Flags<[NoXarchOption,CC1Option]>, Group, HelpText<"Only run the preprocessor">; def F : JoinedOrSeparate<["-"], "F">, Flags<[RenderJoined,CC1Option]>, HelpText<"Add directory to framework include search path">; -def G : JoinedOrSeparate<["-"], "G">, Flags<[DriverOption]>, Group, +def G : JoinedOrSeparate<["-"], "G">, Flags<[NoXarchOption]>, Group, MetaVarName<"">, HelpText<"Put objects of at most bytes " "into small data section (MIPS / Hexagon)">; -def G_EQ : Joined<["-"], "G=">, Flags<[DriverOption]>, Group, Alias; +def G_EQ : Joined<["-"], "G=">, Flags<[NoXarchOption]>, Group, Alias; def H : Flag<["-"], "H">, Flags<[CC1Option]>, Group, HelpText<"Show header includes and nesting depth">; def I_ : Flag<["-"], "I-">, Group, @@ -436,9 +436,9 @@ def Mach : Flag<["-"], "Mach">, Group; def O0 : Flag<["-"], "O0">, Group, Flags<[CC1Option, HelpHidden]>; def O4 : Flag<["-"], "O4">, Group, Flags<[CC1Option, HelpHidden]>; -def ObjCXX : Flag<["-"], "ObjC++">, Flags<[DriverOption]>, +def ObjCXX : Flag<["-"], "ObjC++">, Flags<[NoXarchOption]>, HelpText<"Treat source input files as Objective-C++ inputs">; -def ObjC : Flag<["-"], "ObjC">, Flags<[DriverOption]>, +def ObjC : Flag<["-"], "ObjC">, Flags<[NoXarchOption]>, HelpText<"Treat source input files as Objective-C inputs">; def O : Joined<["-"], "O">, Group, Flags<[CC1Option]>; def O_flag : Flag<["-"], "O">, Flags<[CC1Option]>, Alias, AliasArgs<["1"]>; @@ -451,7 +451,7 @@ HelpText<"Do not emit metadata containing compiler name and version">; def : Flag<["-"], "fident">, Group, Alias, Flags<[CC1Option]>; def : Flag<["-"], "fno-ident">, Group, Alias, Flags<[CC1Option]>; -def Qunused_arguments : Flag<["-"], "Qunused-arguments">, Flags<[DriverOption, CoreOption]>, +def Qunused_arguments : Flag<["-"], "Qunused-arguments">, Flags<[NoXarchOption, CoreOption]>, HelpText<"Don't emit warning for unused driver arguments">; def Q : Flag<["-"], "Q">, IgnoredGCCCompat; def Rpass_EQ : Joined<["-"], "Rpass=">, Group, Flags<[CC1Option]>, @@ -467,7 +467,7 @@ "name matches the given POSIX regular expression">; def R_Joined : Joined<["-"], "R">, Group, Flags<[CC1Option, CoreOption]>, MetaVarName<"">, HelpText<"Enable the specified remark">; -def S : Flag<["-"], "S">, Flags<[DriverOption,CC1Option]>, Group, +def S : Flag<["-"], "S">, Flags<[NoXarchOption,CC1Option]>, Group, HelpText<"Only run preprocess and compilation steps">; def Tbss : JoinedOrSeparate<["-"], "Tbss">, Group, MetaVarName<"">, HelpText<"Set starting address of BSS to ">; @@ -479,7 +479,7 @@ MetaVarName<"