]> granicus.if.org Git - clang/commitdiff
[modules] Rename -fmodule-maps to -fimplicit-module-maps (and likewise for
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 16 Jun 2015 00:20:23 +0000 (00:20 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 16 Jun 2015 00:20:23 +0000 (00:20 +0000)
-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

docs/Modules.rst
include/clang/Driver/CC1Options.td
include/clang/Driver/Options.td
lib/Driver/Tools.cpp
test/Driver/modules.mm

index 4c2b8887a748ca0976dcf9029dc31f1faf2074e6..5598c09a197601e6a5d846fd2cfba47d54365b4d 100644 (file)
@@ -159,7 +159,7 @@ Module maps are specified as separate files (each named ``module.modulemap``) al
 
   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.
   
-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.
+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.
 
 Compilation model
 -----------------
@@ -174,8 +174,8 @@ Command-line parameters
 ``-fmodules``
   Enable the modules feature.
 
-``-fmodule-maps``
-  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.
+``-fimplicit-module-maps``
+  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.
 
 ``-fmodules-cache-path=<directory>``
   Specify the path to the modules cache. If not provided, Clang will select a system-appropriate default.
index cc62fb4d9144f7030da537157cd1094f1fea1398..f2ef71e2f9199628dc370ef889e8259498613884 100644 (file)
@@ -352,8 +352,6 @@ def ast_dump_filter : Separate<["-"], "ast-dump-filter">,
   HelpText<"Use with -ast-dump or -ast-print to dump/print only AST declaration"
            " nodes having a certain substring in a qualified name. Use"
            " -ast-list to list all filterable declaration node names.">;
-def fimplicit_module_maps : Flag<["-"], "fimplicit-module-maps">,
-  HelpText<"Implicitly search the file system for module map files.">;
 def fno_modules_global_index : Flag<["-"], "fno-modules-global-index">,
   HelpText<"Do not automatically generate or update the global module index">;
 def fno_modules_error_recovery : Flag<["-"], "fno-modules-error-recovery">,
index 493757aba3f714d43c894c2fe77bd015bfdd0c5a..d5f316b5f58298bdd30444d50b63ed6f414de201 100644 (file)
@@ -691,9 +691,10 @@ def fmodules_validate_system_headers : Flag<["-"], "fmodules-validate-system-hea
 def fmodules : Flag <["-"], "fmodules">, Group<f_Group>,
   Flags<[DriverOption, CC1Option]>,
   HelpText<"Enable the 'modules' language feature">;
-def fmodule_maps : Flag <["-"], "fmodule-maps">, Group<f_Group>,
-  Flags<[DriverOption]>,
-  HelpText<"Read module maps to understand the structure of library headers">;
+def fimplicit_module_maps : Flag <["-"], "fimplicit-module-maps">, Group<f_Group>,
+  Flags<[DriverOption, CC1Option]>,
+  HelpText<"Implicitly search the file system for module map files.">;
+def fmodule_maps : Flag <["-"], "fmodule-maps">, Alias<fimplicit_module_maps>;
 def fmodule_name : JoinedOrSeparate<["-"], "fmodule-name=">, Group<f_Group>,
   Flags<[DriverOption,CC1Option]>, MetaVarName<"<name>">,
   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
     Flags<[CC1Option]>, HelpText<"Disallow merging of constants">;
 def fno_modules : Flag <["-"], "fno-modules">, Group<f_Group>,
   Flags<[DriverOption]>;
-def fno_module_maps : Flag <["-"], "fno-module-maps">, Group<f_Group>,
+def fno_implicit_module_maps : Flag <["-"], "fno-implicit-module-maps">, Group<f_Group>,
   Flags<[DriverOption]>;
+def fno_module_maps : Flag <["-"], "fno-module-maps">, Alias<fno_implicit_module_maps>;
 def fno_modules_decluse : Flag <["-"], "fno-modules-decluse">, Group<f_Group>,
   Flags<[DriverOption]>;
 def fno_modules_strict_decluse : Flag <["-"], "fno-strict-modules-decluse">, Group<f_Group>,
index 99352a4de07a75cae459e8a044ca434d9d87c883..a3a9d0b847af32dfd9d09046a080d44bbf4d7c8b 100644 (file)
@@ -4151,8 +4151,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
 
   // -fmodule-maps enables implicit reading of module map files. By default,
   // this is enabled if we are using precompiled modules.
-  if (Args.hasFlag(options::OPT_fmodule_maps, options::OPT_fno_module_maps,
-                   HaveModules)) {
+  if (Args.hasFlag(options::OPT_fimplicit_module_maps,
+                   options::OPT_fno_implicit_module_maps, HaveModules)) {
     CmdArgs.push_back("-fimplicit-module-maps");
   }
 
index 63db69956e459eeba497ed0bf6e1f2cff2707028..d1536c73a1f3b1ce581b3f1165ad8b7520050dc4 100644 (file)
@@ -6,3 +6,10 @@
 // RUN: %clang -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s
 // RUN: %clang -fmodules -fno-cxx-modules -fcxx-modules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s
 // CHECK-HAS-MODULES: -fmodules
+
+// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MAPS %s
+// RUN: %clang -fimplicit-module-maps -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MAPS %s
+// RUN: %clang -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MAPS %s
+// RUN: %clang -fmodules -fno-implicit-module-maps -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MAPS %s
+// CHECK-HAS-MAPS: -fimplicit-module-maps
+// CHECK-NO-MAPS-NOT: -fimplicit-module-maps