summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/ModuleMap.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [modules] Retain the name as written for umbrella headers and directories, ↵Richard Smith2015-05-161-7/+13
| | | | | | rather than converting to an absolute path. No observable change expected, but this allows us to correctly compute the module for an umbrella header, which later changes will require. llvm-svn: 237508
* [modules] Add local submodule visibility support for declarations.Richard Smith2015-05-151-30/+30
| | | | | | | | | | | | With this change, enabling -fmodules-local-submodule-visibility results in name visibility rules being applied to submodules of the current module in addition to imported modules (that is, names no longer "leak" between submodules of the same top-level module). This also makes it much safer to textually include a non-modular library into a module: each submodule that textually includes that library will get its own "copy" of that library, and so the library becomes visible no matter which including submodule you import. llvm-svn: 237473
* [modules] Start moving the module visibility information off the Module itself.Richard Smith2015-05-011-3/+4
| | | | | | | It has no place there; it's not a property of the Module, and it makes restoring the visibility set when we leave a submodule more difficult. llvm-svn: 236300
* [modules] Restrict the module use-declaration to only appear in top-levelRichard Smith2015-03-261-17/+13
| | | | | | | modules, and allow sub-modules of a module with a use-declaration to make use of the nominated modules. llvm-svn: 233323
* Remove many superfluous SmallString::str() calls.Yaron Keren2015-03-181-6/+5
| | | | | | | | | | | | | | | Now that SmallString is a first-class citizen, most SmallString::str() calls are not required. This patch removes a whole bunch of them, yet there are lots more. There are two use cases where str() is really needed: 1) To use one of StringRef member functions which is not available in SmallString. 2) To convert to std::string, as StringRef implicitly converts while SmallString do not. We may wish to change this, but it may introduce ambiguity. llvm-svn: 232622
* When building a module, all headers of submodules can be used.Daniel Jasper2015-03-131-1/+2
| | | | | | This extends r232159. llvm-svn: 232168
* Make a module "use" also count as use of all its submodulesDaniel Jasper2015-03-131-3/+5
| | | | llvm-svn: 232159
* [modules] This check is run before we resolve the header, not after, so justRichard Smith2015-03-101-21/+14
| | | | | | | check that private headers are in a list matching the role. (We can't perform the opposite checks for non-private headers because we infer those.) llvm-svn: 231728
* [modules] Don't assert if the same header is named as both a public and aRichard Smith2015-03-091-9/+18
| | | | | | private header within the same module. llvm-svn: 231725
* Allow errors on use of a private module header to be disabled, to better ↵Richard Smith2015-02-191-3/+3
| | | | | | support incremental transition to modules. llvm-svn: 229788
* [modules] Accept //-style comments in module maps on purpose rather than byRichard Smith2015-02-141-1/+3
| | | | | | accident, and accept them even when they begin '//*'. llvm-svn: 229240
* [modules] If we have a choice between including a file textually and importingRichard Smith2015-02-131-2/+17
| | | | | | a prebuilt form from a module, prefer the modular form, all else being equal. llvm-svn: 229188
* Inherit attributes when infering a framework moduleBen Langmuir2015-01-131-24/+23
| | | | | | | | | | If a module map contains framework module * [extern_c] {} We will now infer [extern_c] on the inferred framework modules (we already inferred [system] as a special case). llvm-svn: 225803
* Remove unused method canInferFrameworkModuleBen Langmuir2015-01-131-24/+0
| | | | llvm-svn: 225801
* Reinstate r223753, reverted in r223759 due to breakage of clang-tools-extra.Richard Smith2014-12-101-15/+11
| | | | | | | | | | | | | | | | | Original commit message: [modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1. For files named by -fmodule-map-file=, and files found by 'extern module' directives, this flag specifies that we should resolve filenames relative to the current working directory rather than relative to the directory in which the module map file resides. This is aimed at fixing path handling, in particular for relative -I paths, when building modules that represent components of the current project (rather than libraries installed on the current system, which the current project has as dependencies, where we'd typically expect the module map files to be looked up implicitly). llvm-svn: 223913
* Revert "[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1."Duncan P. N. Exon Smith2014-12-091-11/+15
| | | | | | | | | | | | | This reverts commit r223753. It broke the Green Dragon build for a few hours: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/2259/ http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/2259/consoleFull#43901905849ba4694-19c4-4d7e-bec5-911270d8a58c I suspect `clang-tools-extra` just needs a follow-up for an API change, but I'm not the right one to look into it. llvm-svn: 223759
* [modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1.Richard Smith2014-12-091-15/+11
| | | | | | | | | | | | | For files named by -fmodule-map-file=, and files found by 'extern module' directives, this flag specifies that we should resolve filenames relative to the current working directory rather than relative to the directory in which the module map file resides. This is aimed at fixing path handling, in particular for relative -I paths, when building modules that represent components of the current project (rather than libraries installed on the current system, which the current project has as dependencies, where we'd typically expect the module map files to be looked up implicitly). llvm-svn: 223753
* Try to fix the MSVC build.Hans Wennborg2014-12-021-8/+8
| | | | llvm-svn: 223105
* [modules] Track how 'header' directives were written in module map files,Richard Smith2014-12-021-46/+63
| | | | | | | | | | | | | rather than trying to extract this information from the FileEntry after the fact. This has a number of beneficial effects. For instance, diagnostic messages for failed module builds give a path relative to the "module root" rather than an absolute file path, and the contents of the module includes file is no longer dependent on what files the including TU happened to inspect prior to triggering the module build. llvm-svn: 223095
* ModuleMap.cpp: fix Windows build, take 2Hans Wennborg2014-10-261-2/+3
| | | | llvm-svn: 220646
* ModuleMap.cpp: fix VS2012 buildHans Wennborg2014-10-261-2/+3
| | | | llvm-svn: 220644
* ModuleMap::addHeader(): Appease msc17.NAKAMURA Takumi2014-10-261-4/+16
| | | | llvm-svn: 220639
* [modules] Support combining 'textual' with 'private'.Richard Smith2014-10-241-73/+59
| | | | llvm-svn: 220589
* Refactor implementation of 'exclude header'.Richard Smith2014-10-231-16/+16
| | | | | | | | | This was not a real header role, and was never exposed to clients of ModuleMap. Remove the enumeration value for it and track it as marking the header as 'known' rather than creating an extra KnownHeader entry that *every single* client ignores. llvm-svn: 220460
* Fix covered-switch warning.Richard Smith2014-10-231-0/+1
| | | | llvm-svn: 220456
* [modules] Add support for 'textual header' directives.Richard Smith2014-10-221-7/+40
| | | | | | | | 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-4/+6
| | | | | | | | | | | | #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
* Verify all the module map files for a pcm are the same on loadBen Langmuir2014-08-121-3/+13
| | | | | | | | | | We already verified the primary module map file (either the one that defines the top-level module, or the one that allows inferring it if it is an inferred framework module). Now we also verify any other module map files that define submodules, such as when there is a module.private.modulemap file. llvm-svn: 215455
* Refactor the module map file used for uniquing a module name out ofBen Langmuir2014-08-091-16/+30
| | | | | | | | | class Module. It's almost always going to be the same as getContainingModule() for top-level modules, so just add a map to cover the remaining cases. This lets us do less bookkeeping to keep the ModuleMap fields up to date. llvm-svn: 215268
* Fix case-sensitivity of inferred framework modulesBen Langmuir2014-07-141-0/+6
| | | | | | | Just because we can open a directory named "COcoa.framework" doesn't mean we should provide a "COcoa" module on a case-insensitive filesystem. llvm-svn: 212975
* Convert StringLiteralParser constructor to use ArrayRef instead of a pointer ↵Craig Topper2014-06-261-1/+1
| | | | | | and count. llvm-svn: 211763
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210780
* [C++11] Use 'nullptr'. Lex edition.Craig Topper2014-05-171-40/+39
| | | | llvm-svn: 209083
* Provide and use a safe Token::getRawIdentifier() accessorAlp Toker2014-05-171-4/+6
| | | | llvm-svn: 209061
* Remove -Wnon-modular-includeBen Langmuir2014-05-081-2/+0
| | | | | | | | | | But keep -Wnon-modular-include-in-[framework-]module This warning is too noisy and doesn't really indicate a problem for most people. Even though it would only really affect people using -Weverything, that seems bad so remove it. llvm-svn: 208345
* Add -Wnon-modular-include* optionsBen Langmuir2014-05-051-34/+50
| | | | | | | | | | | | Warn on non-modular includes in various contexts. -Wnon-modular-include -Wnon-modular-include-in-module -Wnon-modular-include-in-framework-module Where each group is a subgroup of those above it. llvm-svn: 208004
* Do not print inferred submodules explicitly in __inferred_module.mapBen Langmuir2014-04-231-0/+2
| | | | | | | | | | | | | | Otherwise including a header in your source file that is not included by framework's umbrella header will silently add an empty submodule with that name. is automatically translated to @import Foo.NotInModule; which then would have succeeded because the inferred module map contained an empty submodule called NotInModule. llvm-svn: 207024
* Allow submodule inferrences with a missing umbrella when the module is ↵Ben Langmuir2014-04-211-1/+2
| | | | | | | | | unavailable If the module is unavailable because of a missing header, don't diagnose a "module * {}" declaration for having a missing umbrella. llvm-svn: 206776
* Don't build modules with (submodules with) missing headersBen Langmuir2014-04-181-2/+10
| | | | | | | | Unless they are in submodules that aren't available anyway, due to requirements not being met. Also, mark children as unavailable when the parent is. llvm-svn: 206664
* Add more constness to module-related APIsDmitri Gribenko2014-04-181-2/+3
| | | | llvm-svn: 206595
* Fixed problem with exclude header. The exclude header argument needs to be ↵John Thompson2014-04-161-22/+0
| | | | | | relative to the module.map file. llvm-svn: 206342
* Allow multiple modules with the same name to coexist in the module cacheBen Langmuir2014-04-141-15/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add -fmodules-strict-decluse to check that all headers are in modulesDaniel Jasper2014-04-111-1/+5
| | | | | Review: http://reviews.llvm.org/D3335 llvm-svn: 206027
* Move search for header in umbrella directories into its own functionBen Langmuir2014-04-101-75/+83
| | | | | | No functional change intended. llvm-svn: 205942
* If a header is explicitly included in module A, and excluded from an umbrellaRichard Smith2014-04-081-6/+17
| | | | | | directory in module B, don't include it in module B! llvm-svn: 205762
* Add a new spelling for module map files 'module.modulemap'Ben Langmuir2014-03-191-4/+15
| | | | | | | | | | | | | | | 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
* Only allow streaming exactly type 'bool' to a DiagnosticBuilder, not anythingRichard Smith2014-03-121-1/+2
| | | | | | | 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
* Add dependencies from imported modules with -MDBen Langmuir2014-03-071-1/+2
| | | | | | | | 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
* Remove a dead store, add a FIXME for another.Richard Smith2014-03-061-0/+1
| | | | llvm-svn: 203169
* If a #include finds a file relative to the current file, don't forget to checkRichard Smith2014-03-051-0/+2
| | | | | | whether it's part of a module. llvm-svn: 203005
OpenPOWER on IntegriCloud