summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/docs/Modules.rst21
-rw-r--r--clang/lib/Driver/Tools.cpp8
-rw-r--r--clang/test/Driver/modules.mm6
3 files changed, 16 insertions, 19 deletions
diff --git a/clang/docs/Modules.rst b/clang/docs/Modules.rst
index f47b6ace091..110a77b5dae 100644
--- a/clang/docs/Modules.rst
+++ b/clang/docs/Modules.rst
@@ -2,10 +2,6 @@
Modules
=======
-.. warning::
- The functionality described on this page is supported for C and
- Objective-C. C++ support is experimental.
-
.. contents::
:local:
@@ -104,7 +100,7 @@ Many programming languages have a module or package system, and because of the v
Using Modules
=============
-To enable modules, pass the command-line flag ``-fmodules`` [#]_. This will make any modules-enabled software libraries available as modules as well as introducing any modules-specific syntax. Additional `command-line parameters`_ are described in a separate section later.
+To enable modules, pass the command-line flag ``-fmodules``. This will make any modules-enabled software libraries available as modules as well as introducing any modules-specific syntax. Additional `command-line parameters`_ are described in a separate section later.
Objective-C Import declaration
------------------------------
@@ -163,13 +159,10 @@ Modules maintain references to each of the headers that were part of the module
Command-line parameters
-----------------------
``-fmodules``
- Enable the modules feature (EXPERIMENTAL).
-
-``-fcxx-modules``
- Enable the modules feature for C++ (EXPERIMENTAL).
+ Enable the modules feature.
``-fmodule-maps``
- Enable interpretation of module maps (EXPERIMENTAL). This option is implied by ``-fmodules``.
+ Enable interpretation of module maps. This option is implied by ``-fmodules``.
``-fmodules-cache-path=<directory>``
Specify the path to the modules cache. If not provided, Clang will select a system-appropriate default.
@@ -240,6 +233,10 @@ The ``#undef`` overrides the ``#define``, and a source file that imports both mo
Module Map Language
===================
+.. warning::
+
+ The module map language is not currently guaranteed to be stable between major revisions of Clang.
+
The module map language describes the mapping from header files to the
logical structure of modules. To enable support for using a library as
a module, one must write a ``module.modulemap`` file for that library. The
@@ -826,7 +823,7 @@ To detect and help address some of these problems, the ``clang-tools-extra`` rep
Future Directions
=================
-Modules is an experimental feature, and there is much work left to do to make it both real and useful. Here are a few ideas:
+Modules support is under active development, and there are many opportunities remaining to improve it. Here are a few ideas:
**Detect unused module imports**
Unlike with ``#include`` directives, it should be fairly simple to track whether a directly-imported module has ever been used. By doing so, Clang can emit ``unused import`` or ``unused #include`` diagnostics, including Fix-Its to remove the useless imports/includes.
@@ -858,8 +855,6 @@ PCHInternals_
.. [#] Automatic linking against the libraries of modules requires specific linker support, which is not widely available.
-.. [#] Modules are only available in C and Objective-C; a separate flag ``-fcxx-modules`` enables modules support for C++, which is even more experimental and broken.
-
.. [#] There are certain anti-patterns that occur in headers, particularly system headers, that cause problems for modules. The section `Modularizing a Platform`_ describes some of them.
.. [#] The second instance is actually a new thread within the current process, not a separate process. However, the original compiler instance is blocked on the execution of this thread.
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 20c88aecc3c..50c101fa6d9 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -3750,14 +3750,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-fblocks-runtime-optional");
}
- // -fmodules enables modules (off by default). However, for C++/Objective-C++,
- // users must also pass -fcxx-modules. The latter flag will disappear once the
- // modules implementation is solid for C++/Objective-C++ programs as well.
+ // -fmodules enables modules (off by default).
+ // Users can pass -fno-cxx-modules to turn off modules support for
+ // C++/Objective-C++ programs, which is a little less mature.
bool HaveModules = false;
if (Args.hasFlag(options::OPT_fmodules, options::OPT_fno_modules, false)) {
bool AllowedInCXX = Args.hasFlag(options::OPT_fcxx_modules,
options::OPT_fno_cxx_modules,
- false);
+ true);
if (AllowedInCXX || !types::isCXX(InputType)) {
CmdArgs.push_back("-fmodules");
HaveModules = true;
diff --git a/clang/test/Driver/modules.mm b/clang/test/Driver/modules.mm
index b2948c4b3d9..63db69956e4 100644
--- a/clang/test/Driver/modules.mm
+++ b/clang/test/Driver/modules.mm
@@ -1,6 +1,8 @@
-// RUN: %clang -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s
+// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s
// RUN: %clang -fcxx-modules -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s
+// RUN: %clang -fmodules -fno-cxx-modules -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s
// CHECK-NO-MODULES-NOT: -fmodules
-// RUN: %clang -fcxx-modules -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s
+// 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
OpenPOWER on IntegriCloud