summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* Reapply r207477 and r207479 without cyclic dependencyBen Langmuir2014-04-294-1/+107
| | | | | | | | Fixed by moving ProcessWarningOptions from Frontend into Basic. All of the dependencies for ProcessWarningOptions were already in Basic, so this was a small change. llvm-svn: 207549
* Revert r207477 (and r207479), "Check -Werror options during module validation"NAKAMURA Takumi2014-04-294-107/+1
| | | | | | It tried to introduce cyclic dependencies. Serialization shouldn't depend on Frontend, since Frontend depends on Serialization. llvm-svn: 207497
* Add missing triple to make -isysroot workBen Langmuir2014-04-291-3/+3
| | | | llvm-svn: 207479
* Check -Werror options during module validationBen Langmuir2014-04-294-1/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch checks whether the diagnostic options that could lead to errors (principally -Werror) are consistent between when a module was built and when it is loaded. If there are new -Werror flags, then the module is rebuilt. In order to canonicalize the options we do this check at the level of the constructed DiagnosticsEngine, which contains the final set of diag to diagnostic level mappings. Currently we only rebuild with the new diagnostic options, but we intend to refine this in the future to include the union of the new and old flags, since we know the old ones did not cause errors. System modules are only rebuilt when -Wsystem-headers is enabled. One oddity is that unlike checking language options, we don’t perform this diagnostic option checking when loading from a precompiled header. The reason for this is that the compiler cannot rebuild the PCH, so anything that requires it to be rebuilt effectively leaks into the build system. And in this case, that would mean the build system understanding the complex relationship between diagnostic options and the underlying diagnostic mappings, which is unreasonable. Skipping the check is safe, because these options do not affect the generated AST. You simply won’t get new build errors due to changed -Werror options automatically, which is also true for non-module cases. llvm-svn: 207477
* If we see an explicit instantiation declaration or definition of a functionRichard Smith2014-04-243-0/+22
| | | | | | | | | | | | | after we've already instantiated a definition for the function, pass it to the ASTConsumer again so that it knows the specialization kind has changed and can update the function's linkage. This only matters if we instantiate the definition of the function before we reach the end of the TU; this can happen in at least three different ways: C++11 constexpr functions, C++14 deduced return types, and functions instantiated within modules. llvm-svn: 207152
* When two templates get merged together, also merge their pattern declarationsRichard Smith2014-04-244-10/+12
| | | | | | | | | | | | | | together. This is extremely hairy, because in general we need to have loaded both the template and the pattern before we can determine whether either should be merged, so we temporarily violate the rule that all merging happens before reading a decl ends, but *only* in the case where a template's pattern is being loaded while loading the template itself. In order to accomodate this for class templates, delay loading the injected class name type for the pattern of the template until after we've loaded the template itself, if we happen to load the template first. llvm-svn: 207063
* Do not print inferred submodules explicitly in __inferred_module.mapBen Langmuir2014-04-231-0/+7
| | | | | | | | | | | | | | 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
* Initial implementation of -modules-earch-all option, for searching for ↵John Thompson2014-04-235-0/+39
| | | | | | symbols in non-imported modules. llvm-svn: 206977
* Allow submodule inferrences with a missing umbrella when the module is ↵Ben Langmuir2014-04-211-0/+6
| | | | | | | | | 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
* When a module completes the definition of a class template specialization ↵Richard Smith2014-04-197-0/+31
| | | | | | imported from another module, emit an update record, rather than using the broken decl rewriting mechanism. If multiple modules do this, merge the definitions together, much as we would if they were separate declarations. llvm-svn: 206680
* Fix a hole with nested unavailable submodules from r206664Ben Langmuir2014-04-181-0/+1
| | | | | | | | If a module doesn't meet a requirement, neither do its submodules. If we don't propogate that, we might think it's an error to be missing a header in one of those submodules. llvm-svn: 206673
* Don't build modules with (submodules with) missing headersBen Langmuir2014-04-183-5/+21
| | | | | | | | 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 missing serialization code for one of the CXXRecordDecl definition flags.Richard Smith2014-04-172-0/+18
| | | | llvm-svn: 206493
* Fixed problem with exclude header. The exclude header argument needs to be ↵John Thompson2014-04-161-1/+1
| | | | | | relative to the module.map file. llvm-svn: 206342
* Make sure these two files are distinct, or else the modules system may, on ↵Nick Lewycky2014-04-142-0/+4
| | | | | | certain file systems, treat them as if they were the same file. llvm-svn: 206221
* Add module name and module map file to -module-file-infoBen Langmuir2014-04-141-0/+3
| | | | llvm-svn: 206217
* Fix find command in test/Modules/prune.m broken by r206201Ben Langmuir2014-04-141-1/+1
| | | | llvm-svn: 206203
* Allow multiple modules with the same name to coexist in the module cacheBen Langmuir2014-04-1414-17/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix test/Modules/cxx-irgen.cpp for PPC64Hal Finkel2014-04-121-3/+3
| | | | | | Target ABI code might add signext to the return types. llvm-svn: 206107
* Add -fmodules-strict-decluse to check that all headers are in modulesDaniel Jasper2014-04-111-0/+9
| | | | | Review: http://reviews.llvm.org/D3335 llvm-svn: 206027
* Have validate-system-headers override validate-once-per-build-sessionBen Langmuir2014-04-081-0/+18
| | | | llvm-svn: 205773
* If a header is explicitly included in module A, and excluded from an umbrellaRichard Smith2014-04-085-0/+17
| | | | | | directory in module B, don't include it in module B! llvm-svn: 205762
* Render anonymous entities as '(anonymous <thing>)' (and lambdas as '(lambda ↵David Blaikie2014-04-021-2/+2
| | | | | | | | | | | | at ... )') For namespaces, this is consistent with mangling and GCC's debug info behavior. For structs, GCC uses <anonymous struct> but we prefer consistency between all anonymous entities but don't want to confuse them with template arguments, etc, so we'll just go with parens in all cases. llvm-svn: 205398
* Add the location of Decls to ast dump.David Blaikie2014-04-021-1/+1
| | | | | | | | | While investigating some debug info issues, Eric and I came across a particular template case where the location of a decl was quite different from the range of the same decl. It might've been rather helpful if the dumper had actually showed us this. llvm-svn: 205396
* Save out a correct lookup table if a lookup table entry is stale (it containsRichard Smith2014-03-254-0/+20
| | | | | | | | | an out-of-date external decls list). This happens if we declare some names, force the lookup table for the decl context to be built, import a module that adds more decls for the name, then write out our module without looking up the name. llvm-svn: 204694
* Add missing file from r204570.Richard Smith2014-03-231-0/+5
| | | | llvm-svn: 204574
* If a name is injected into an imported inline namespace without reopening thatRichard Smith2014-03-233-0/+13
| | | | | | | namespace, we need to update both the visible names of that namespace and of its enclosing namespace set. llvm-svn: 204570
* When we inject a declaration into a namespace, add the primary DeclContext toRichard Smith2014-03-233-0/+12
| | | | | | | the update set rather than the current DeclContext. Add test for the local extern case too. llvm-svn: 204568
* If a template instantation introduces a name into a namespace, we need to writeRichard Smith2014-03-233-0/+12
| | | | | | | out a visible update record for that namespace even if it was never declared in this module. llvm-svn: 204554
* If an update record makes a declaration interesting, pass it to the consumer.Richard Smith2014-03-233-3/+14
| | | | llvm-svn: 204550
* Emit an update record if we instantiate the definition of a function templateRichard Smith2014-03-224-0/+27
| | | | | | | | specialization from a module. (This can also happen for function template specializations in PCHs if they're instantiated eagerly, because they're constexpr or have a deduced return type.) llvm-svn: 204547
* Refactor: move loading pending instantiations from chained PCHs to a more ↵Richard Smith2014-03-221-0/+3
| | | | | | appropriate place, so that we only ask the external source once. llvm-svn: 204535
* PR19215: When writing/reading a PCH that imported a module, store the locationRichard Smith2014-03-214-0/+14
| | | | | | | at which that PCH imported each visible submodule of the module. Such locations are needed when synthesizing macro directives resulting from the import. llvm-svn: 204417
* Prevent lookup of subframework modules by name without parent frameworkBen Langmuir2014-03-201-0/+5
| | | | | | | | | | | | | We were 'allowing' the following import @import Sub; where Sub is a subframework of Foo and we had a -F path inside Foo.framework/Frameworks and no module map file for Sub. This would later hit assertion failures in debug builds. Now we should correctly diagnose this as a module not found error. llvm-svn: 204368
* Add a new spelling for module map files 'module.modulemap'Ben Langmuir2014-03-1917-0/+45
| | | | | | | | | | | | | | | 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
* Use the expansion location of the file name when finding the module.Manuel Klimek2014-03-194-0/+33
| | | | | | | | The spelling location of stringified strings is not a file location. Optimally, we'll want to solve the problem (as the FIXME states) by handing in the right FileEntry of the #include location. llvm-svn: 204220
* modify declare-use.S to work when full toolchain not presentMatthew Curtis2014-03-181-1/+1
| | | | | | | | Test doesn't actually require production of an object file and for some targets (e.g. hexagon) an assembler is not always available when lit tests are run. llvm-svn: 204144
* clang/test/Modules/cxx-templates.cpp: Tweak for dos path.NAKAMURA Takumi2014-03-181-1/+1
| | | | llvm-svn: 204116
* AST dumper: if we have multiple implicit instantiations of the same classRichard Smith2014-03-181-0/+11
| | | | | | | template specialization (from different modules), dump them all, so that every declaration is dumped somewhere. llvm-svn: 204100
* Don't verify module inclusions in assembler files.Daniel Jasper2014-03-143-0/+9
| | | | llvm-svn: 203929
* [Modules] Emit the module file paths as dependencies of the PCH when we are ↵Argyrios Kyrtzidis2014-03-141-0/+12
| | | | | | | | | | | building one. This is because the PCH is tied to the module files, if one of the module files changes or gets removed the build system should re-build the PCH file. rdar://16321245 llvm-svn: 203885
* [Modules] Make sure that the synthesized file "__inferred_module.map" ↵Argyrios Kyrtzidis2014-03-141-0/+8
| | | | | | | | doesn't show up as dependency of a module file. Follow-up for rdar://15459210 llvm-svn: 203882
* Add an option -fmodules-validate-system-headersBen Langmuir2014-03-121-0/+25
| | | | | | | | When enabled, always validate the system headers when loading a module. The end result of this is that when these headers change, we will notice and rebuild the module. llvm-svn: 203630
* clang/test/Modules/include-relative.c REQUIRES shell due to chdir.NAKAMURA Takumi2014-03-111-0/+1
| | | | llvm-svn: 203550
* If a visibility update record is found for a DeclContext after that Decl hasRichard Smith2014-03-115-0/+12
| | | | | | | already been loaded, apply that update record to the Decl immediately, rather than adding it to a pending list and never applying it. llvm-svn: 203534
* If a module map is found in a relative -I path, convert the filenames within itRichard Smith2014-03-113-0/+13
| | | | | | | | to absolute paths when building the includes file for the module. Without this, the module build would fail, because the relative paths we were using are not necessarily relative to a directory in our include path. llvm-svn: 203528
* When a type's definition is instantiated, the definition becomes visible, evenRichard Smith2014-03-107-0/+82
| | | | | | | | | if the type's declaration was previously instantiated in an unimported module. (For an imported type definition, this already worked, because the source location is set to the location of the definition, but for locally-instantiated type definitions, it did not.) llvm-svn: 203425
* Module [extern_c] attribute: inherit to submodules, don't write 'extern "C"'Richard Smith2014-03-084-4/+21
| | | | | | blocks when building in C mode, and serialize and deserialize the attribute. llvm-svn: 203317
* Tweak some test paths to match on WindowsBen Langmuir2014-03-071-4/+4
| | | | llvm-svn: 203215
* Add a bunch of missing changes from r203208Ben Langmuir2014-03-071-5/+7
| | | | | | Somehow lost these in a git operation. llvm-svn: 203210
OpenPOWER on IntegriCloud