#
62bcd925 |
| 18-Apr-2014 |
Dmitri Gribenko <gribozavr@gmail.com> |
Add more constness to module-related APIs
llvm-svn: 206595
|
#
28331ae6 |
| 16-Apr-2014 |
John Thompson <John.Thompson.JTSoftware@gmail.com> |
Fixed problem with exclude header. The exclude header argument needs to be relative to the module.map file.
llvm-svn: 206342
|
#
beee15e7 |
| 14-Apr-2014 |
Ben Langmuir <blangmuir@apple.com> |
Allow multiple modules with the same name to coexist in the module cache
To differentiate between two modules with the same name, we will consider the path the module map file that they are defined
Allow multiple modules with the same name to coexist in the module cache
To differentiate between two modules with the same name, we will consider the path the module map file that they are defined by* part of the ‘key’ for looking up the precompiled module (pcm file). Specifically, this patch renames the precompiled module (pcm) files from cache-path/<module hash>/Foo.pcm to cache-path/<module hash>/Foo-<hash of module map path>.pcm
In addition, I’ve taught the ASTReader to re-resolve the names of imported modules during module loading so that if the header search context changes between when a module was originally built and when it is loaded we can rebuild it if necessary. For example, if module A imports module B
first time: clang -I /path/to/A -I /path/to/B ...
second time: clang -I /path/to/A -I /different/path/to/B ...
will now rebuild A as expected.
* in the case of inferred modules, we use the module map file that allowed the inference, not the __inferred_module.map file, since the inferred file path is the same for every inferred module.
llvm-svn: 206201
show more ...
|
Revision tags: llvmorg-3.4.1-rc1 |
|
#
962b38e4 |
| 11-Apr-2014 |
Daniel Jasper <djasper@google.com> |
Add -fmodules-strict-decluse to check that all headers are in modules
Review: http://reviews.llvm.org/D3335 llvm-svn: 206027
|
#
4469138e |
| 10-Apr-2014 |
Ben Langmuir <blangmuir@apple.com> |
Move search for header in umbrella directories into its own function
No functional change intended.
llvm-svn: 205942
|
#
50996ce1 |
| 08-Apr-2014 |
Richard Smith <richard-llvm@metafoo.co.uk> |
If a header is explicitly included in module A, and excluded from an umbrella directory in module B, don't include it in module B!
llvm-svn: 205762
|
#
984e1df7 |
| 19-Mar-2014 |
Ben Langmuir <blangmuir@apple.com> |
Add a new spelling for module map files 'module.modulemap'
This name, while more verbose, plays more nicely with tools that use file extensions to determine file types. The existing spelling 'module
Add a new spelling for module map files 'module.modulemap'
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
show more ...
|
#
5b5d21ea |
| 12-Mar-2014 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Only allow streaming exactly type 'bool' to a DiagnosticBuilder, not anything that implicitly converts to 'bool' (such as pointers, and the first operand of ?:). Clean up issues found by this. Patch
Only allow streaming exactly type 'bool' to a DiagnosticBuilder, not anything that implicitly converts to 'bool' (such as pointers, and the first operand of ?:). Clean up issues found by this. Patch by Stephan Tolksdorf!
llvm-svn: 203735
show more ...
|
#
cb69b57b |
| 07-Mar-2014 |
Ben Langmuir <blangmuir@apple.com> |
Add dependencies from imported modules with -MD
Add module dependencies to the dependency files created by -MD/-MMD/etc. by attaching an ASTReaderListener that will call into the dependency file gen
Add dependencies from imported modules with -MD
Add module dependencies to the dependency files created by -MD/-MMD/etc. by attaching an ASTReaderListener that will call into the dependency file generator when a module input file is seen in the serialized AST.
llvm-svn: 203208
show more ...
|
#
131daca0 |
| 06-Mar-2014 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Remove a dead store, add a FIXME for another.
llvm-svn: 203169
|
#
8c71eba1 |
| 05-Mar-2014 |
Richard Smith <richard-llvm@metafoo.co.uk> |
If a #include finds a file relative to the current file, don't forget to check whether it's part of a module.
llvm-svn: 203005
|
#
77944868 |
| 02-Mar-2014 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Add [extern_c] attribute for modules, allowing a C module to be imported within an extern "C" block in C++ code.
llvm-svn: 202615
|
Revision tags: llvmorg-3.4.0 |
|
#
92669ee4 |
| 20-Dec-2013 |
Daniel Jasper <djasper@google.com> |
Enable layering check in unavailable modules.
If a header file belonging to a certain module is not found on the filesystem, that header gets marked as unavailable. Now, the layering warning (-fmodu
Enable layering check in unavailable modules.
If a header file belonging to a certain module is not found on the filesystem, that header gets marked as unavailable. Now, the layering warning (-fmodules-decluse) should still warn about headers of this module being wrongfully included. Currently, headers belonging to those modules are just treated as not belonging to modules at all which means they can be included freely from everywhere.
To implement this (somewhat) cleanly, I have moved most of the layering checks into the ModuleMap. This will also help with showing FixIts later.
llvm-svn: 197805
show more ...
|
#
0761a8a0 |
| 17-Dec-2013 |
Daniel Jasper <djasper@google.com> |
Modules: Don't warn upon missing headers while reading the module map.
Instead, mark the module as unavailable so that clang errors as soon as someone tries to build this module.
This works towards
Modules: Don't warn upon missing headers while reading the module map.
Instead, mark the module as unavailable so that clang errors as soon as someone tries to build this module.
This works towards the long-term goal of not stat'ing the header files at all while reading the module map and instead read them only when the module is being built (there is a corresponding FIXME in parseHeaderDecl()). However, it seems non-trivial to get there and this unblock us and moves us into the right direction.
Also changed the implementation to reuse the same DiagnosticsEngine.
llvm-svn: 197485
show more ...
|
Revision tags: llvmorg-3.4.0-rc3 |
|
#
34dc4811 |
| 16-Dec-2013 |
Daniel Jasper <djasper@google.com> |
Revert "Modules: Make missing headers in a module.map a warning not an error."
This was committed accidentally.
llvm-svn: 197389
|
#
5c6ee49f |
| 16-Dec-2013 |
Daniel Jasper <djasper@google.com> |
Modules: Make missing headers in a module.map a warning not an error.
Instead, mark the module as unavailable so that clang errors as soon as someone tries to build this module.
A better long-term
Modules: Make missing headers in a module.map a warning not an error.
Instead, mark the module as unavailable so that clang errors as soon as someone tries to build this module.
A better long-term strategy might be to not stat the header files at all while reading the module map and instead read them only when the module is being built (there is a corresponding FIXME in parseHeaderDecl()). However, it seems non-trivial to get there and this would be a temporary solution to unblock us.
Also changed the implementation to reuse the same DiagnosticsEngine as otherwise warnings can't be enabled or disabled with command-line flags.
llvm-svn: 197388
show more ...
|
#
4eaf0a6c |
| 11-Dec-2013 |
Daniel Jasper <djasper@google.com> |
Modules: Let -fmodules-decluse ignore headers that aren't in a module
Includes might always pull in arbitrary header or data files outside of modules. Among others, this includes builtin includes, w
Modules: Let -fmodules-decluse ignore headers that aren't in a module
Includes might always pull in arbitrary header or data files outside of modules. Among others, this includes builtin includes, which do not have a module (story) yet.
Also cleanup implementation of ModuleMap::findModuleForHeader() to be non-recursive.
llvm-svn: 197034
show more ...
|
#
3cd34c76 |
| 06-Dec-2013 |
Daniel Jasper <djasper@google.com> |
Allow string literals as module names.
In order to make the migration to modules easier, it seems to be helpful to allow a 1:1 mapping between target names of a current build system and the correspo
Allow string literals as module names.
In order to make the migration to modules easier, it seems to be helpful to allow a 1:1 mapping between target names of a current build system and the corresponding C++ modules. As such targets commonly contain characters like "-". ":" and "/", allowing arbitrary quote-escaped strings seems to be a straightforward option.
After several offline discussions, the precise mechanisms for C++ module names especially regarding submodules and import statements has yet to be determined. Thus, this patch only enables string literals as names inside the module map files which can be used by automatic module import (through #include).
Also improve the error message on missing use-declarations.
llvm-svn: 196573
show more ...
|
Revision tags: llvmorg-3.4.0-rc2, llvmorg-3.4.0-rc1 |
|
#
a3feee2a |
| 28-Oct-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Allow a new syntax in a module requires-declaration:
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 b
Allow a new syntax in a module requires-declaration:
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
show more ...
|
#
1f76c4e8 |
| 24-Oct-2013 |
Manuel Klimek <klimek@google.com> |
Use the same SourceManager for ModuleMaps and compilations.
This allows using virtual file mappings on the original SourceManager to map in virtual module.map files. Without this patch, the ModuleMa
Use the same SourceManager for ModuleMaps and compilations.
This allows using virtual file mappings on the original SourceManager to map in virtual module.map files. Without this patch, the ModuleMap search will find a module.map file (as the FileEntry exists in the FileManager), but will be unable to get the content from the SourceManager (as ModuleMap previously created its own SourceManager).
Two problems needed to be fixed which this patch exposed:
1. Storing the inferred module map When writing out a module, the ASTWriter stores the names of the files in the main source manager; when loading the AST again, the ASTReader errs out if such a file is found missing, unless it is overridden. Previously CompilerInstance's compileModule method would store the inferred module map to a temporary file; the problem with this approach is that now that the module map is handled by the main source manager, the ASTWriter stores the name of the temporary module map as source to the compilation; later, when the module is loaded, the temporary file has already been deleted, which leads to a compilation error. This patch changes the inferred module map to instead inject a virtual file into the source manager. This both saves some disk IO, and works with how the ASTWriter/ASTReader handle overridden source files.
2. Changing test input in test/Modules/Inputs/* Now that the module map file is handled by the main source manager, the VerifyDiagnosticConsumer will not ignore diagnostics created while parsing the module map file. The module test test/Modules/renamed.m uses -I test/Modules/Inputs and triggers recursive loading of all module maps in test/Modules/Inputs, some of which had conflicting names, thus leading errors while parsing the module maps. Those diagnostics already occur on trunk, but before this patch they would not break the test, as they were ignored by the VerifyDiagnosticConsumer. This patch thus changes the module maps that have been recently introduced which broke the invariant of compatible modules maps in test/Modules/Inputs.
llvm-svn: 193314
show more ...
|
#
97da9178 |
| 22-Oct-2013 |
Daniel Jasper <djasper@google.com> |
Allow a header to be part of multiple modules.
This patch changes two things:
a) Allow a header to be part of multiple modules. The reasoning is that in existing codebases that have a module-like b
Allow a header to be part of multiple modules.
This patch changes two things:
a) Allow a header to be part of multiple modules. The reasoning is that in existing codebases that have a module-like build system, the same headers might be used in several build targets. Simple reasons might be that they defined different classes that are declared in the same header. Supporting a header as a part of multiple modules will make the transistion easier for those cases. A later step in clang can then determine whether the two modules are actually compatible and can be merged and error out appropriately. The later check is similar to what needs to be done for template specializations anyway.
b) Allow modules to be stored in a directory tree separate from the headers they describe.
Review: http://llvm-reviews.chandlerc.com/D1951 llvm-svn: 193151
show more ...
|
#
9a59e2c6 |
| 24-Sep-2013 |
Daniel Jasper <djasper@google.com> |
Fix uninitialized value bug discovered buy msan buildbot.
llvm-svn: 191292
|
#
ba7f2f71 |
| 24-Sep-2013 |
Daniel Jasper <djasper@google.com> |
Module use declarations (II)
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 or
Module use declarations (II)
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
show more ...
|
#
2d4d8cb3 |
| 11-Sep-2013 |
Benjamin Kramer <benny.kra@googlemail.com> |
Simplify code with the in place path::native. No functionality change.
llvm-svn: 190515
|
#
97292843 |
| 11-Sep-2013 |
Daniel Jasper <djasper@google.com> |
Support for modular module-map-files
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 "exte
Support for modular module-map-files
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
show more ...
|