summaryrefslogtreecommitdiffstats
path: root/clang/docs/Modules.rst
diff options
context:
space:
mode:
Diffstat (limited to 'clang/docs/Modules.rst')
-rw-r--r--clang/docs/Modules.rst25
1 files changed, 22 insertions, 3 deletions
diff --git a/clang/docs/Modules.rst b/clang/docs/Modules.rst
index 7bd2adf8af5..ed6f8171573 100644
--- a/clang/docs/Modules.rst
+++ b/clang/docs/Modules.rst
@@ -469,9 +469,16 @@ A header declaration specifies that a particular header is associated with the e
.. parsed-literal::
*header-declaration*:
- ``private``:sub:`opt` ``textual``:sub:`opt` ``header`` *string-literal*
- ``umbrella`` ``header`` *string-literal*
- ``exclude`` ``header`` *string-literal*
+ ``private``:sub:`opt` ``textual``:sub:`opt` ``header`` *string-literal* *header-attrs*:sub:`opt`
+ ``umbrella`` ``header`` *string-literal* *header-attrs*:sub:`opt`
+ ``exclude`` ``header`` *string-literal* *header-attrs*:sub:`opt`
+
+ *header-attrs*:
+ '{' *header-attr** '}'
+
+ *header-attr*:
+ ``size`` *integer-literal*
+ ``mtime`` *integer-literal*
A header declaration that does not contain ``exclude`` nor ``textual`` specifies a header that contributes to the enclosing module. Specifically, when the module is built, the named header will be parsed and its declarations will be (logically) placed into the enclosing submodule.
@@ -504,6 +511,18 @@ A header with the ``exclude`` specifier is excluded from the module. It will not
A given header shall not be referenced by more than one *header-declaration*.
+Two *header-declaration*\s, or a *header-declaration* and a ``#include``, are
+considered to refer to the same file if the paths resolve to the same file
+and the specified *header-attr*\s (if any) match the attributes of that file,
+even if the file is named differently (for instance, by a relative path or
+via symlinks).
+
+.. note::
+ The use of *header-attr*\s avoids the need for Clang to speculatively
+ ``stat`` every header referenced by a module map. It is recommended that
+ *header-attr*\s only be used in machine-generated module maps, to avoid
+ mismatches between attribute values and the corresponding files.
+
Umbrella directory declaration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An umbrella directory declaration specifies that all of the headers in the specified directory should be included within the module.
OpenPOWER on IntegriCloud