[PATCH] D106791: [clang-cl] Expose -fmodules and related flags in the driver (PR43391)
Hans Wennborg via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 27 02:33:06 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa648f3434274: [clang-cl] Expose -fmodules and related flags in the driver (PR43391) (authored by hans).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106791/new/
https://reviews.llvm.org/D106791
Files:
clang/include/clang/Driver/Options.td
clang/test/Driver/cl-options.c
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 \
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<f_Group>,
- Flags<[NoXarchOption, CC1Option]>,
+ Flags<[NoXarchOption, CC1Option, CoreOption]>,
HelpText<"Implicitly search the file system for module map files.">,
MarshallingInfoFlag<HeaderSearchOpts<"ImplicitModuleMaps">>;
def fmodules_ts : Flag <["-"], "fmodules-ts">, Group<f_Group>,
@@ -2148,42 +2148,43 @@
defm modules : BoolFOption<"modules",
LangOpts<"Modules">, Default<!strconcat(fmodules_ts.KeyPath, "||", cpp_modules.KeyPath)>,
PosFlag<SetTrue, [CC1Option], "Enable the 'modules' language feature">,
- NegFlag<SetFalse>, BothFlags<[NoXarchOption]>>;
-def fmodule_maps : Flag <["-"], "fmodule-maps">, Alias<fimplicit_module_maps>;
+ NegFlag<SetFalse>, BothFlags<[NoXarchOption, CoreOption]>>;
+def fmodule_maps : Flag <["-"], "fmodule-maps">, Flags<[CoreOption]>, Alias<fimplicit_module_maps>;
def fmodule_name_EQ : Joined<["-"], "fmodule-name=">, Group<f_Group>,
- Flags<[NoXarchOption,CC1Option]>, MetaVarName<"<name>">,
+ Flags<[NoXarchOption,CC1Option,CoreOption]>, MetaVarName<"<name>">,
HelpText<"Specify the name of the module to build">,
MarshallingInfoString<LangOpts<"ModuleName">>;
def fmodule_implementation_of : Separate<["-"], "fmodule-implementation-of">,
- Flags<[CC1Option]>, Alias<fmodule_name_EQ>;
-def fsystem_module : Flag<["-"], "fsystem-module">, Flags<[CC1Option]>,
+ Flags<[CC1Option,CoreOption]>, Alias<fmodule_name_EQ>;
+def fsystem_module : Flag<["-"], "fsystem-module">, Flags<[CC1Option,CoreOption]>,
HelpText<"Build this module as a system module. Only used with -emit-module">,
MarshallingInfoFlag<FrontendOpts<"IsSystemModule">>;
def fmodule_map_file : Joined<["-"], "fmodule-map-file=">,
- Group<f_Group>, Flags<[NoXarchOption,CC1Option]>, MetaVarName<"<file>">,
+ Group<f_Group>, Flags<[NoXarchOption,CC1Option,CoreOption]>, MetaVarName<"<file>">,
HelpText<"Load this module map file">,
MarshallingInfoStringVector<FrontendOpts<"ModuleMapFiles">>;
def fmodule_file : Joined<["-"], "fmodule-file=">,
- Group<i_Group>, Flags<[NoXarchOption,CC1Option]>, MetaVarName<"[<name>=]<file>">,
+ Group<i_Group>, Flags<[NoXarchOption,CC1Option,CoreOption]>, MetaVarName<"[<name>=]<file>">,
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<f_Group>, Flags<[CC1Option]>,
+def fmodules_ignore_macro : Joined<["-"], "fmodules-ignore-macro=">, Group<f_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<f_Group>,
- Flags<[NoXarchOption,CC1Option]>,
+ Flags<[NoXarchOption,CC1Option,CoreOption]>,
HelpText<"Like -fmodules-decluse but requires all headers to be in modules">,
MarshallingInfoFlag<LangOpts<"ModulesStrictDeclUse">>;
defm modules_decluse : BoolFOption<"modules-decluse",
LangOpts<"ModulesDeclUse">, Default<fmodules_strict_decluse.KeyPath>,
PosFlag<SetTrue, [CC1Option], "Require declaration of modules used within a module">,
- NegFlag<SetFalse>, BothFlags<[NoXarchOption]>>;
+ NegFlag<SetFalse>, BothFlags<[NoXarchOption,CoreOption]>>;
defm modules_search_all : BoolFOption<"modules-search-all",
LangOpts<"ModulesSearchAll">, DefaultFalse,
PosFlag<SetTrue, [], "Search even non-imported modules to resolve references">,
- NegFlag<SetFalse>, BothFlags<[NoXarchOption, CC1Option]>>,
+ NegFlag<SetFalse>, BothFlags<[NoXarchOption, CC1Option,CoreOption]>>,
ShouldParseIf<fmodules.KeyPath>;
defm implicit_modules : BoolFOption<"implicit-modules",
LangOpts<"ImplicitModules">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option]>, PosFlag<SetTrue>, BothFlags<[NoXarchOption]>>;
+ NegFlag<SetFalse, [CC1Option]>, PosFlag<SetTrue>, BothFlags<[NoXarchOption,CoreOption]>>;
def fretain_comments_from_system_headers : Flag<["-"], "fretain-comments-from-system-headers">, Group<f_Group>, Flags<[CC1Option]>,
MarshallingInfoFlag<LangOpts<"RetainCommentsFromSystemHeaders">>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106791.361952.patch
Type: text/x-patch
Size: 5545 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210727/d9cbd86a/attachment-0001.bin>
More information about the cfe-commits
mailing list