summaryrefslogtreecommitdiffstats
path: root/clang/docs/Modules.rst
Commit message (Collapse)AuthorAgeFilesLines
* [Docs] Modernize references to macOSJ. Ryan Stinnett2019-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This updates all places in documentation that refer to "Mac OS X", "OS X", etc. to instead use the modern name "macOS" when no specific version number is mentioned. If a specific version is mentioned, this attempts to use the OS name at the time of that version: * Mac OS X for 10.0 - 10.7 * OS X for 10.8 - 10.11 * macOS for 10.12 - present Reviewers: JDevlieghere Subscribers: mgorny, christof, arphaman, cfe-commits, lldb-commits, libcxx-commits, llvm-commits Tags: #clang, #lldb, #libc, #llvm Differential Revision: https://reviews.llvm.org/D62654 llvm-svn: 362113
* [Modules] Add platform and environment features to requires clauseBruno Cardoso Lopes2018-09-181-1/+6
| | | | | | | | | | | | | Allows module map writers to add build requirements based on platform/os. This helps when target features and language dialects aren't enough to conditionalize building a module, among other things, it allow module maps for different platforms to live in the same file. rdar://problem/43909745 Differential Revision: https://reviews.llvm.org/D51910 llvm-svn: 342499
* [Modules] Add more language features to be used with requires-declarationBruno Cardoso Lopes2018-02-141-0/+15
| | | | | | | | | Features added: c99, c11, c17, cplusplus14 and cplusplus17. rdar://problem/36328787 rdar://problem/36668431 llvm-svn: 325154
* [Modules] Change private modules rules and warningsBruno Cardoso Lopes2017-12-221-14/+15
| | | | | | | | | | | | | | | | We used to advertise private modules to be declared as submodules (Foo.Private). This has proven to not scale well since private headers might carry several dependencies, introducing unwanted content into the main module and often causing dep cycles. Change the canonical way to name it to Foo_Private, forcing private modules as top level ones, and provide warnings under -Wprivate-module to suggest fixes for other private naming. Update documentation to reflect that. rdar://problem/31173501 llvm-svn: 321337
* Fix reStructuredText warning.Douglas Gregor2017-09-141-1/+1
| | | | llvm-svn: 313320
* Minor cleanups to address feedback from Bruno. NFCDouglas Gregor2017-09-141-8/+7
| | | | llvm-svn: 313318
* [Module map] Introduce a private module re-export directive.Douglas Gregor2017-09-141-1/+28
| | | | | | | | | | | | | Introduce a new "export_as" directive for top-level modules, which indicates that the current module is a "private" module whose symbols will eventually be exported through the named "public" module. This is in support of a common pattern in the Darwin ecosystem where a single public framework is constructed of several private frameworks, with (currently) header duplication and some support from the linker. Addresses rdar://problem/34438420. llvm-svn: 313316
* [modules] Add ability to specify module name to module file mapping (reapply)Boris Kolpackov2017-08-311-3/+8
| | | | | | | | | | | | | | | | | | | | Extend the -fmodule-file option to support the [<name>=]<file> value format. If the name is omitted, then the old semantics is preserved (the module file is loaded whether needed or not). If the name is specified, then the mapping is treated as just another prebuilt module search mechanism, similar to -fprebuilt-module-path, and the module file is only loaded if actually used (e.g., via import). With one exception: this mapping also overrides module file references embedded in other modules (which can be useful if module files are moved/renamed as often happens during remote compilation). This override semantics requires some extra work: we now store the module name in addition to the file name in the serialized AST representation. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D35020 llvm-svn: 312220
* Revert r312105 [modules] Add ability to specify module name to module file ↵Victor Leschuk2017-08-301-8/+3
| | | | | | | | mapping Looks like it breaks win10 builder. llvm-svn: 312112
* [modules] Add ability to specify module name to module file mappingBoris Kolpackov2017-08-301-3/+8
| | | | | | | | | | | | | | | | | | | | Extend the -fmodule-file option to support the [<name>=]<file> value format. If the name is omitted, then the old semantics is preserved (the module file is loaded whether needed or not). If the name is specified, then the mapping is treated as just another prebuilt module search mechanism, similar to -fprebuilt-module-path, and the module file is only loaded if actually used (e.g., via import). With one exception: this mapping also overrides module file references embedded in other modules (which can be useful if module files are moved/renamed as often happens during remote compilation). This override semantics requires some extra work: we now store the module name in addition to the file name in the serialized AST representation. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D35020 llvm-svn: 312105
* Revert accidentally-committed files.Richard Smith2017-08-031-108/+731
| | | | llvm-svn: 309976
* Don't emit undefined-internal warnings for CXXDeductionGuideDecls.Richard Smith2017-08-031-731/+108
| | | | | | Patch by ~paul (cynecx on phabricator)! Some test massaging by me. llvm-svn: 309975
* Support lazy stat'ing of files referenced by module maps.Richard Smith2017-06-021-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for a `header` declaration in a module map to specify certain `stat` information (currently, size and mtime) about that header file. This has two purposes: - It removes the need to eagerly `stat` every file referenced by a module map. Instead, we track a list of unresolved header files with each size / mtime (actually, for simplicity, we track submodules with such headers), and when attempting to look up a header file based on a `FileEntry`, we check if there are any unresolved header directives with that `FileEntry`'s size / mtime and perform deferred `stat`s if so. - It permits a preprocessed module to be compiled without the original files being present on disk. The only reason we used to need those files was to get the `stat` information in order to do header -> module lookups when using the module. If we're provided with the `stat` information in the preprocessed module, we can avoid requiring the files to exist. Unlike most `header` directives, if a `header` directive with `stat` information has no corresponding on-disk file the enclosing module is *not* marked unavailable (so that behavior is consistent regardless of whether we've resolved a header directive, and so that preprocessed modules don't get marked unavailable). We could actually do this for all `header` directives: the only reason we mark the module unavailable if headers are missing is to give a diagnostic slightly earlier (rather than waiting until we actually try to build the module / load and validate its .pcm file). Differential Revision: https://reviews.llvm.org/D33703 llvm-svn: 304515
* [modules] Minor documentation clarification for behavior of ↵Richard Smith2017-05-301-1/+1
| | | | | | requires-declaration. llvm-svn: 304253
* [coroutines] Support "coroutines" feature in module map requires clauseEric Fiselier2017-05-281-0/+3
| | | | | | | | | | | | | | Summary: In order for libc++ to add `<experimental/coroutine>` to its module map, there has to be a feature that can be used to detect if coroutines support is enabled in Clang. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33538 llvm-svn: 304107
* Revert "[coroutines] Support "coroutines" feature in module map requires clause"Eric Fiselier2017-05-271-3/+0
| | | | | | This reverts commit r304054. llvm-svn: 304057
* [coroutines] Support "coroutines" feature in module map requires clauseEric Fiselier2017-05-271-0/+3
| | | | | | | | | | | | | | Summary: In order for libc++ to add `<experimental/coroutine>` to its module map, there has to be a feature that can be used to detect if coroutines support is enabled in Clang. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33538 llvm-svn: 304054
* [Modules] Add documentation on private frameworksBruno Cardoso Lopes2017-03-161-0/+11
| | | | | | | | | 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
* [Modules] Add a command line option for loading the clang builtins modulemap.Elad Cohen2016-10-311-0/+3
| | | | | | | | | -fbuiltin-module-map loads the clang builtins modulemap file. (This is equivalent to -fmodule-map-file=<resource dir>/include/module.modulemap) Differential Revision: https://reviews.llvm.org/D25767 llvm-svn: 285548
* [Modules] Add 'no_undeclared_includes' module map attributeBruno Cardoso Lopes2016-10-211-0/+2
| | | | | | | | | | | | | The 'no_undeclared_includes' attribute should be used in a module to tell that only non-modular headers and headers from used modules are accepted. The main motivation behind this is to prevent dep cycles between system libraries (such as darwin) and libc++. Patch by Richard Smith! llvm-svn: 284797
* [Modules] Add 'freestanding' to the 'requires-declaration' feature-list.Elad Cohen2016-09-041-0/+3
| | | | | | | | | This adds support for modules that require (non-)freestanding environment, such as the compiler builtin mm_malloc submodule. Differential Revision: https://reviews.llvm.org/D23871 llvm-svn: 280613
* [Modules] Add 'gnuinlineasm' to the 'requires-declaration' feature-list.Bruno Cardoso Lopes2016-08-301-0/+3
| | | | | | | | | | | | | This adds support for modules that require (no-)gnu-inline-asm environment, such as the compiler builtin cpuid submodule. This is the gnu-inline-asm variant of https://reviews.llvm.org/D23871 Differential Revision: https://reviews.llvm.org/D23905 rdar://problem/26931199 llvm-svn: 280159
* Module: add -fprebuilt-module-path to support loading prebuilt modules.Manman Ren2016-08-181-0/+3
| | | | | | | | | | | | | In this mode, there is no need to load any module map and the programmer can simply use "@import" syntax to load the module directly from a prebuilt module path. When loading from prebuilt module path, we don't support rebuilding of the module files and we ignore compatible configuration mismatches. rdar://27290316 Differential Revision: http://reviews.llvm.org/D23125 llvm-svn: 279096
* Fix a typo.Adrian Prantl2015-09-171-1/+1
| | | | llvm-svn: 247895
* Fix "the the" in comments/documentation/etc.Eric Christopher2015-06-191-1/+1
| | | | llvm-svn: 240110
* [modules] Rename -fmodule-maps to -fimplicit-module-maps (and likewise forRichard Smith2015-06-161-3/+3
| | | | | | -fno-module-maps). The old names are preserved for compatibility. llvm-svn: 239792
* [modules] Remove non-functional driver options -f[no-]modules-implicit-maps.Richard Smith2015-06-151-4/+1
| | | | | | | These driver options never did anything (they weren't forwarded to the frontend). Also update the documentation to not mention them. llvm-svn: 239787
* [modules] Restrict the module use-declaration to only appear in top-levelRichard Smith2015-03-261-8/+17
| | | | | | | modules, and allow sub-modules of a module with a use-declaration to make use of the nominated modules. llvm-svn: 233323
* Add -fno-implicit-modules.Manuel Klimek2015-02-201-0/+6
| | | | | | | If this flag is set, we error out when a module build is required. This is useful in environments where all required modules are passed via -fmodule-file. llvm-svn: 230006
* Add flag -f(no-)modules-implicit-maps.Daniel Jasper2014-11-251-0/+3
| | | | | | | This suppresses the implicit search for files called 'module.modulemap' and similar. llvm-svn: 222745
* [modules] Support combining 'textual' with 'private'.Richard Smith2014-10-241-6/+5
| | | | llvm-svn: 220589
* [modules] Add support for 'textual header' directives.Richard Smith2014-10-221-5/+14
| | | | | | | | This allows a module to specify that it logically contains a file, but that said file is non-modular and intended for textual inclusion. This allows layering checks to work properly in the presence of such files. llvm-svn: 220448
* [modules] Add support for #include_next.Richard Smith2014-10-201-0/+13
| | | | | | | | | | | | #include_next interacts poorly with modules: it depends on where in the list of include paths the current file was found. Files covered by module maps are not found in include search paths when building the module (and are not found in include search paths when @importing the module either), so this isn't really meaningful. Instead, we fake up the result that #include_next *should* have given: find the first path that would have resulted in the given file being picked, and search from there onwards. llvm-svn: 220177
* Enable both C and C++ modules with -fmodules, by switching -fcxx-modules toRichard Smith2014-09-301-13/+8
| | | | | | | | | | | | | | | | | being on by default. -fno-cxx-modules can still be used to enable C modules but not C++ modules, but C++ modules is not significantly less stable than C modules any more. Also remove some of the scare words from the modules documentation. We're certainly not going to remove modules support (though we might change the interface), and it works well enough to bootstrap and build lots of non-trivial code. Note that this does not represent a commitment to the current interface nor implementation, and we still intend to follow whatever direction the C and C++ committees take regarding modules support. llvm-svn: 218717
* Update modules documentation now that C++ support is working pretty well.Richard Smith2014-09-291-6/+3
| | | | llvm-svn: 218614
* [modules] Slightly expand module semantics documentation.Richard Smith2014-07-241-1/+3
| | | | llvm-svn: 213838
* Initial implementation of -modules-earch-all option, for searching for ↵John Thompson2014-04-231-0/+3
| | | | | | symbols in non-imported modules. llvm-svn: 206977
* Fix sphinx-build warnings in clang docs.Reid Kleckner2014-04-181-2/+2
| | | | llvm-svn: 206661
* Rename lib/Headers/module.map to module.modulemapBen Langmuir2014-04-171-1/+1
| | | | | | Don't install a file using the legacy spelling. llvm-svn: 206431
* Documentation: remove a spurious '1' and wrap to 80 columnsDmitri Gribenko2014-03-281-1/+4
| | | | llvm-svn: 205035
* Document module.private.modulemap and module_private.map.Douglas Gregor2014-03-281-1/+58
| | | | | | Requested in <rdar://problem/16188740>. llvm-svn: 205030
* Add a new spelling for module map files 'module.modulemap'Ben Langmuir2014-03-191-4/+7
| | | | | | | | | | | | | | | This name, while more verbose, plays more nicely with tools that use file extensions to determine file types. The existing spelling 'module.map' will continue to work, but the new spelling will take precedence. In frameworks, this new filename will only go in a new 'Modules' sub-directory. Similarly, add a module.private.modulemap corresponding to module_private.map. llvm-svn: 204261
* Add [extern_c] attribute for modules, allowing a C module to be imported ↵Richard Smith2014-03-021-2/+4
| | | | | | within an extern "C" block in C++ code. llvm-svn: 202615
* If a module A exports a macro M, and a module B imports that macro and #undef'sRichard Smith2014-03-011-0/+34
| | | | | | | | | | | | | | it, importers of B should not see the macro. This is complicated by the fact that A's macro could also be visible through a different path. The rules (as hashed out on cfe-commits) are included as a documentation update in this change. With this, the number of regressions in libc++'s testsuite when modules are enabled drops from 47 to 7. Those remaining 7 are also macro-related, and are due to remaining bugs in this change (in particular, the handling of submodules is imperfect). llvm-svn: 202560
* Modules: Fix malformed reStructuredTextDavid Majnemer2014-02-251-1/+1
| | | | llvm-svn: 202117
* Allow a new syntax in a module requires-declaration:Richard Smith2013-10-281-2/+5
| | | | | | | | | | | | requires ! feature The purpose of this is to allow (for instance) the module map for /usr/include to exclude <tgmath.h> and <complex.h> when building in C++ (these headers are instead provided by the C++ standard library in this case, and the glibc C <tgmath.h> header would otherwise try to include <complex.h>, resulting in a module cycle). llvm-svn: 193549
* Note that modules are supported for C/Objective-C, and have syntax in ObjC.Douglas Gregor2013-09-271-13/+14
| | | | llvm-svn: 191562
* Add -fmodule-map-file option.Daniel Jasper2013-09-241-0/+3
| | | | | | | | | | | | | | | With this option, arbitrarily named module map files can be specified to be loaded as required for headers in the respective (sub)directories. This, together with the extern module declaration allows for specifying module maps in a modular fashion without the need for files called "module.map". Among other things, this allows a directory to contain two modules that are completely independent of one another. Review: http://llvm-reviews.chandlerc.com/D1697. llvm-svn: 191284
* Module use declarations (II)Daniel Jasper2013-09-241-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Review: http://llvm-reviews.chandlerc.com/D1546. I have picked up this patch form Lawrence (http://llvm-reviews.chandlerc.com/D1063) and did a few changes. From the original change description (updated as appropriate): This patch adds a check that ensures that modules only use modules they have so declared. To this end, it adds a statement on intended module use to the module.map grammar: use module-id A module can then only use headers from other modules if it 'uses' them. This enforcement is off by default, but may be turned on with the new option -fmodules-decluse. When enforcing the module semantics, we also need to consider a source file part of a module. This is achieved with a compiler option -fmodule-name=<module-id>. The compiler at present only applies restrictions to the module directly being built. llvm-svn: 191283
* Support for modular module-map-filesDaniel Jasper2013-09-111-0/+4
| | | | | | | | | | | | | | | | | | | This patch is the first step to make module-map-files modular (instead of requiring a single "module.map"-file per include directory). This step adds a new "extern module" declaration that enables module-map-files to reference one another along with a very basic implementation. The next steps are: * Combine this with the use-declaration (from http://llvm-reviews.chandlerc.com/D1546) in order to only load module map files required for a specific compilation. * Add an additional flag to start with a specific module-map-file (instead of requiring there to be at least one "module.map"). Review: http://llvm-reviews.chandlerc.com/D1637 llvm-svn: 190497
OpenPOWER on IntegriCloud