Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -2139,7 +2139,7 @@ "debug info for types in an object file built from this PCH and do not generate them elsewhere">; def fimplicit_module_maps : Flag <["-"], "fimplicit-module-maps">, Group, - Flags<[NoXarchOption, CC1Option]>, + Flags<[NoXarchOption, CC1Option, CoreOption]>, HelpText<"Implicitly search the file system for module map files.">, MarshallingInfoFlag>; def fmodules_ts : Flag <["-"], "fmodules-ts">, Group, @@ -2148,42 +2148,43 @@ defm modules : BoolFOption<"modules", LangOpts<"Modules">, Default, PosFlag, - NegFlag, BothFlags<[NoXarchOption]>>; -def fmodule_maps : Flag <["-"], "fmodule-maps">, Alias; + NegFlag, BothFlags<[NoXarchOption, CoreOption]>>; +def fmodule_maps : Flag <["-"], "fmodule-maps">, Flags<[CoreOption]>, Alias; def fmodule_name_EQ : Joined<["-"], "fmodule-name=">, Group, - Flags<[NoXarchOption,CC1Option]>, MetaVarName<"">, + Flags<[NoXarchOption,CC1Option,CoreOption]>, MetaVarName<"">, HelpText<"Specify the name of the module to build">, MarshallingInfoString>; def fmodule_implementation_of : Separate<["-"], "fmodule-implementation-of">, - Flags<[CC1Option]>, Alias; -def fsystem_module : Flag<["-"], "fsystem-module">, Flags<[CC1Option]>, + Flags<[CC1Option,CoreOption]>, Alias; +def fsystem_module : Flag<["-"], "fsystem-module">, Flags<[CC1Option,CoreOption]>, HelpText<"Build this module as a system module. Only used with -emit-module">, MarshallingInfoFlag>; def fmodule_map_file : Joined<["-"], "fmodule-map-file=">, - Group, Flags<[NoXarchOption,CC1Option]>, MetaVarName<"">, + Group, Flags<[NoXarchOption,CC1Option,CoreOption]>, MetaVarName<"">, HelpText<"Load this module map file">, MarshallingInfoStringVector>; def fmodule_file : Joined<["-"], "fmodule-file=">, - Group, Flags<[NoXarchOption,CC1Option]>, MetaVarName<"[=]">, + Group, Flags<[NoXarchOption,CC1Option,CoreOption]>, MetaVarName<"[=]">, HelpText<"Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.">; -def fmodules_ignore_macro : Joined<["-"], "fmodules-ignore-macro=">, Group, Flags<[CC1Option]>, +def fmodules_ignore_macro : Joined<["-"], "fmodules-ignore-macro=">, Group, + Flags<[CC1Option,CoreOption]>, HelpText<"Ignore the definition of the given macro when building and loading modules">; def fmodules_strict_decluse : Flag <["-"], "fmodules-strict-decluse">, Group, - Flags<[NoXarchOption,CC1Option]>, + Flags<[NoXarchOption,CC1Option,CoreOption]>, HelpText<"Like -fmodules-decluse but requires all headers to be in modules">, MarshallingInfoFlag>; defm modules_decluse : BoolFOption<"modules-decluse", LangOpts<"ModulesDeclUse">, Default, PosFlag, - NegFlag, BothFlags<[NoXarchOption]>>; + NegFlag, BothFlags<[NoXarchOption,CoreOption]>>; defm modules_search_all : BoolFOption<"modules-search-all", LangOpts<"ModulesSearchAll">, DefaultFalse, PosFlag, - NegFlag, BothFlags<[NoXarchOption, CC1Option]>>, + NegFlag, BothFlags<[NoXarchOption, CC1Option,CoreOption]>>, ShouldParseIf; defm implicit_modules : BoolFOption<"implicit-modules", LangOpts<"ImplicitModules">, DefaultTrue, - NegFlag, PosFlag, BothFlags<[NoXarchOption]>>; + NegFlag, PosFlag, BothFlags<[NoXarchOption,CoreOption]>>; def fretain_comments_from_system_headers : Flag<["-"], "fretain-comments-from-system-headers">, Group, Flags<[CC1Option]>, MarshallingInfoFlag>; Index: clang/test/Driver/cl-options.c =================================================================== --- clang/test/Driver/cl-options.c +++ clang/test/Driver/cl-options.c @@ -710,6 +710,23 @@ // RUN: -fcs-profile-generate \ // RUN: -fcs-profile-generate=dir \ // RUN: -ftime-trace \ +// RUN: -fmodules \ +// RUN: -fno-modules \ +// RUN: -fimplicit-module-maps \ +// RUN: -fmodule-maps \ +// RUN: -fmodule-name=foo \ +// RUN: -fmodule-implementation-of \ +// RUN: -fsystem-module \ +// RUN: -fmodule-map-file=foo \ +// RUN: -fmodule-file=foo \ +// RUN: -fmodules-ignore-macro=foo \ +// RUN: -fmodules-strict-decluse \ +// RUN: -fmodules-decluse \ +// RUN: -fno-modules-decluse \ +// RUN: -fmodules-search-all \ +// RUN: -fno-modules-search-all \ +// RUN: -fimplicit-modules \ +// RUN: -fno-implicit-modules \ // RUN: -ftrivial-auto-var-init=zero \ // RUN: -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang \ // RUN: --version \