summaryrefslogtreecommitdiffstats
path: root/clang/docs
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2017-03-16 23:18:55 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2017-03-16 23:18:55 +0000
commit448d4289b0cd8899df8aff349adef2961bc08c4c (patch)
tree6ea6b1eb001dbb233f3bb6a0cf3702cdfd46d7b2 /clang/docs
parent20670ba52cdcb74ebf8aa630f686b6c5278869b9 (diff)
downloadbcm5719-llvm-448d4289b0cd8899df8aff349adef2961bc08c4c.tar.gz
bcm5719-llvm-448d4289b0cd8899df8aff349adef2961bc08c4c.zip
[Modules] Add documentation on private frameworks
Expand a bit on private modules with some guidance on how to write them in the context of frameworks. rdar://problem/24758771 llvm-svn: 298012
Diffstat (limited to 'clang/docs')
-rw-r--r--clang/docs/Modules.rst11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/docs/Modules.rst b/clang/docs/Modules.rst
index 141d3b85753..2b1bde2fedc 100644
--- a/clang/docs/Modules.rst
+++ b/clang/docs/Modules.rst
@@ -360,6 +360,7 @@ The ``framework`` qualifier specifies that this module corresponds to a Darwin-s
Name.framework/
Modules/module.modulemap Module map for the framework
Headers/ Subdirectory containing framework headers
+ PrivateHeaders/ Subdirectory containing framework private headers
Frameworks/ Subdirectory containing embedded frameworks
Resources/ Subdirectory containing additional resources
Name Symbolic link to the shared library for the framework
@@ -842,6 +843,16 @@ would be available when ``Foo_Private.h`` is available, making it
easier to split a library's public and private APIs along header
boundaries.
+When writing a private module as part of a *framework*, it's recommended that:
+
+* Headers for this module are present in the ``PrivateHeaders``
+ framework subdirectory.
+* The private module is defined as a *submodule* of the public framework (if
+ there's one), similar to how ``Foo.Private`` is defined in the example above.
+* The ``explicit`` keyword should be used to guarantee that its content will
+ only be available when the submodule itself is explicitly named (through a
+ ``@import`` for example).
+
Modularizing a Platform
=======================
To get any benefit out of modules, one needs to introduce module maps for software libraries starting at the bottom of the stack. This typically means introducing a module map covering the operating system's headers and the C standard library headers (in ``/usr/include``, for a Unix system).
OpenPOWER on IntegriCloud