Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 1991fe2

Browse files
committed
[modules] Rename -fmodule-maps to -fimplicit-module-maps (and likewise for
-fno-module-maps). The old names are preserved for compatibility. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239792 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 067f774 commit 1991fe2

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

docs/Modules.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Module maps are specified as separate files (each named ``module.modulemap``) al
159159

160160
To actually see any benefits from modules, one first has to introduce module maps for the underlying C standard library and the libraries and headers on which it depends. The section `Modularizing a Platform`_ describes the steps one must take to write these module maps.
161161

162-
One can use module maps without modules to check the integrity of the use of header files. To do this, use the ``-fmodule-maps`` option instead of the ``-fmodules`` option.
162+
One can use module maps without modules to check the integrity of the use of header files. To do this, use the ``-fimplicit-module-maps`` option instead of the ``-fmodules`` option, or use ``-fmodule-map-file=`` option to explicitly specify the module map files to load.
163163

164164
Compilation model
165165
-----------------
@@ -174,8 +174,8 @@ Command-line parameters
174174
``-fmodules``
175175
Enable the modules feature.
176176

177-
``-fmodule-maps``
178-
Enable implicit search for module map files named ``module.modulemap`` and similar. This option is implied by ``-fmodules``. If this is disabled, module map files will only be loaded if they are explicitly specified via ``-fmodule-map-file`` or transitively used by another module map file.
177+
``-fimplicit-module-maps``
178+
Enable implicit search for module map files named ``module.modulemap`` and similar. This option is implied by ``-fmodules``. If this is disabled with ``-fno-implicit-module-maps``, module map files will only be loaded if they are explicitly specified via ``-fmodule-map-file`` or transitively used by another module map file.
179179

180180
``-fmodules-cache-path=<directory>``
181181
Specify the path to the modules cache. If not provided, Clang will select a system-appropriate default.

include/clang/Driver/CC1Options.td

-2
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,6 @@ def ast_dump_filter : Separate<["-"], "ast-dump-filter">,
352352
HelpText<"Use with -ast-dump or -ast-print to dump/print only AST declaration"
353353
" nodes having a certain substring in a qualified name. Use"
354354
" -ast-list to list all filterable declaration node names.">;
355-
def fimplicit_module_maps : Flag<["-"], "fimplicit-module-maps">,
356-
HelpText<"Implicitly search the file system for module map files.">;
357355
def fno_modules_global_index : Flag<["-"], "fno-modules-global-index">,
358356
HelpText<"Do not automatically generate or update the global module index">;
359357
def fno_modules_error_recovery : Flag<["-"], "fno-modules-error-recovery">,

include/clang/Driver/Options.td

+6-4
Original file line numberDiff line numberDiff line change
@@ -691,9 +691,10 @@ def fmodules_validate_system_headers : Flag<["-"], "fmodules-validate-system-hea
691691
def fmodules : Flag <["-"], "fmodules">, Group<f_Group>,
692692
Flags<[DriverOption, CC1Option]>,
693693
HelpText<"Enable the 'modules' language feature">;
694-
def fmodule_maps : Flag <["-"], "fmodule-maps">, Group<f_Group>,
695-
Flags<[DriverOption]>,
696-
HelpText<"Read module maps to understand the structure of library headers">;
694+
def fimplicit_module_maps : Flag <["-"], "fimplicit-module-maps">, Group<f_Group>,
695+
Flags<[DriverOption, CC1Option]>,
696+
HelpText<"Implicitly search the file system for module map files.">;
697+
def fmodule_maps : Flag <["-"], "fmodule-maps">, Alias<fimplicit_module_maps>;
697698
def fmodule_name : JoinedOrSeparate<["-"], "fmodule-name=">, Group<f_Group>,
698699
Flags<[DriverOption,CC1Option]>, MetaVarName<"<name>">,
699700
HelpText<"Specify the name of the module to build">;
@@ -774,8 +775,9 @@ def fno_merge_all_constants : Flag<["-"], "fno-merge-all-constants">, Group<f_Gr
774775
Flags<[CC1Option]>, HelpText<"Disallow merging of constants">;
775776
def fno_modules : Flag <["-"], "fno-modules">, Group<f_Group>,
776777
Flags<[DriverOption]>;
777-
def fno_module_maps : Flag <["-"], "fno-module-maps">, Group<f_Group>,
778+
def fno_implicit_module_maps : Flag <["-"], "fno-implicit-module-maps">, Group<f_Group>,
778779
Flags<[DriverOption]>;
780+
def fno_module_maps : Flag <["-"], "fno-module-maps">, Alias<fno_implicit_module_maps>;
779781
def fno_modules_decluse : Flag <["-"], "fno-modules-decluse">, Group<f_Group>,
780782
Flags<[DriverOption]>;
781783
def fno_modules_strict_decluse : Flag <["-"], "fno-strict-modules-decluse">, Group<f_Group>,

lib/Driver/Tools.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4151,8 +4151,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
41514151

41524152
// -fmodule-maps enables implicit reading of module map files. By default,
41534153
// this is enabled if we are using precompiled modules.
4154-
if (Args.hasFlag(options::OPT_fmodule_maps, options::OPT_fno_module_maps,
4155-
HaveModules)) {
4154+
if (Args.hasFlag(options::OPT_fimplicit_module_maps,
4155+
options::OPT_fno_implicit_module_maps, HaveModules)) {
41564156
CmdArgs.push_back("-fimplicit-module-maps");
41574157
}
41584158

test/Driver/modules.mm

+7
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,10 @@
66
// RUN: %clang -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s
77
// RUN: %clang -fmodules -fno-cxx-modules -fcxx-modules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s
88
// CHECK-HAS-MODULES: -fmodules
9+
10+
// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MAPS %s
11+
// RUN: %clang -fimplicit-module-maps -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MAPS %s
12+
// RUN: %clang -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MAPS %s
13+
// RUN: %clang -fmodules -fno-implicit-module-maps -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MAPS %s
14+
// CHECK-HAS-MAPS: -fimplicit-module-maps
15+
// CHECK-NO-MAPS-NOT: -fimplicit-module-maps

0 commit comments

Comments
 (0)