summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/Inputs
Commit message (Collapse)AuthorAgeFilesLines
...
* [modules] Track the described template in an alias declaration that is theRichard Smith2014-08-263-0/+8
| | | | | | | pattern of an alias template declaration. Use this to merge alias templates properly when they're members of class template specializations. llvm-svn: 216437
* Fix typo.Richard Smith2014-08-252-0/+5
| | | | llvm-svn: 216417
* [modules] Fix false report of an ODR violation when merging friendRichard Smith2014-08-252-1/+13
| | | | | | | | | | declarations. We can't expect to find them in the canonical definition of the class, because that's not where they live. This means we no longer reject real ODR violations with friend declarations, but we weren't consistently doing so anyway. llvm-svn: 216369
* [modules] When merging a tag declaration that has a typedef name for linkageRichard Smith2014-08-232-0/+11
| | | | | | | purposes, look for other typedefs with that same name and merge into their named tag declaration if there is one. llvm-svn: 216312
* [modules] Put class template declarations into the scope in which they'reRichard Smith2014-08-232-0/+4
| | | | | | | | | | | declared, rather than putting them into the template parameter scope. We previously had *no record* in the scope for class template declarations, once those declarations completed and their template parameter scopes were popped. This in turn caused us to be unable to merge class template declarations that were declared in the global scope (where we use scope lookup rather than DeclContext lookup for merging), when loading a module. llvm-svn: 216311
* [modules] Turn off a broken optimization: we need to pick up implicit specialRichard Smith2014-08-142-0/+19
| | | | | | | members from all redefinitions of a class that have them, in case the special member is defined in one module but only declared in another. llvm-svn: 215675
* [modules] Don't assert if the same imported class template specializationRichard Smith2014-08-143-0/+6
| | | | | | | declaration has its definition instantiated in two sibling modules and they use a partial specialization. llvm-svn: 215616
* [modules] When we merge together multiple class template specializationRichard Smith2014-08-143-0/+6
| | | | | | | | | | definitions (because some other declaration declares a special member that isn't present in the canonical definition), we need to search *all* of them; we can't just stop when we find the requested name in any of the definitions, because that can fail to find things (and in particular, it can fail to find the member of the canonical declaration and return a bogus ODR failure). llvm-svn: 215612
* [modules] Fix a rejects-valid resulting from emitting an inline functionRichard Smith2014-08-131-0/+11
| | | | | | | | recursively within the emission of another inline function. This ultimately led to us emitting the same inline function definition twice, which we then rejected because we believed we had a mangled name conflict. llvm-svn: 215579
* Default getFile() to use the last accessed name in the FileEntry.Manuel Klimek2014-08-132-0/+4
| | | | | | | | | | | | With modules we start accessing headers for the first time while reading the module map, which often has very different paths from the include scanning logic. Using the name by which the file was accessed gets us one step closer to the right solution, which is using a FileName abstraction that decouples the name by which a file was accessed from the FileEntry. llvm-svn: 215541
* [modules] When performing a lookup into a namespace, ensure that any laterRichard Smith2014-08-137-0/+25
| | | | | | | | | | redefinitions of that namespace have already been loaded. When writing out the names in a namespace, if we see a name that is locally declared and had imported declarations merged on top of it, export the local declaration as the lookup result, because it will be the most recent declaration of that entity in the redeclaration chain of an importer of the module. llvm-svn: 215518
* Verify all the module map files for a pcm are the same on loadBen Langmuir2014-08-123-0/+3
| | | | | | | | | | 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
* [modules] When considering merging a newly-declared typedef into an importedRichard Smith2014-08-105-0/+32
| | | | | | | | | one, perform the import if the types match even if the imported declaration is hidden. Otherwise, NamedDecl::declarationReplaces will drop one of the name lookup entries, making the typedef effectively inaccessible from one of the modules that declared it. llvm-svn: 215306
* [modules] Weaken an out-of-date assertion: an #undef can have no location if weRichard Smith2014-08-094-0/+9
| | | | | | | imported it from a module when performing finalization before writing out an AST file. llvm-svn: 215272
* [modules] When emitting an update record containing the body of a destructor,Richard Smith2014-08-072-0/+12
| | | | | | | | | also emit the updated 'operator delete' looked up for that destructor. Switch from UpdateDecl to an actual update record when this happens due to implicitly defining a special member function and unify this code path and the one for instantiating a function definition. llvm-svn: 215132
* [modules] Maintain an AST invariant across module load/save: if any declarationRichard Smith2014-07-313-0/+37
| | | | | | | | | | | | | | | of a function has a resolved exception specification, then all declarations of the function do. We should probably improve the AST representation to make this implicit (perhaps only store the exception specification on the canonical declaration), but this fixes things for now. The testcase for this (which used to assert) also exposes the actual bug I was trying to reduce here: we sometimes fail to emit the body of an imported special member function definition. Fix for that to follow. llvm-svn: 214458
* [modules] Add testcase for a bug reduced from a selfhost issue. This bug wasRichard Smith2014-07-292-0/+8
| | | | | | | never present in Clang trunk, but was present in some of my development work, and it seems like a useful test to have. llvm-svn: 214154
* Revert accidentally-committed files in r214151.Richard Smith2014-07-292-8/+0
| | | | llvm-svn: 214152
* [modules] Add missing #include, found by modules build. We need a classRichard Smith2014-07-292-0/+8
| | | | | | definition in order to apply isa<...>. llvm-svn: 214151
* [modules] PR20475: merging support for alias template declarations.Richard Smith2014-07-282-0/+4
| | | | llvm-svn: 214124
* [modules] Fix some of the confusion when computing the override set for a macroRichard Smith2014-07-213-0/+7
| | | | | | | introduced by finalization. This is still not entirely correct; more fixes to follow. llvm-svn: 213498
* Reinstate r213348, reverted in r213395, with an additional bug fix and moreRichard Smith2014-07-187-0/+21
| | | | | | | | | | | | | | | | | | | | thorough tests. Original commit message: [modules] Fix macro hiding bug exposed if: * A submodule of module A is imported into module B * Another submodule of module A that is not imported into B exports a macro * Some submodule of module B also exports a definition of the macro, and happens to be the first submodule of B that imports module A. In this case, we would incorrectly determine that A's macro redefines B's macro, and so we don't need to re-export B's macro at all. This happens with the 'assert' macro in an LLVM self-host. =( llvm-svn: 213416
* Revert "[modules] Fix macro hiding bug exposed if:"Ben Langmuir2014-07-186-16/+0
| | | | | | | | | | This is breaking the system modules on Darwin, because something that was defined and re-exported no longer is. Might be this patch, or might just be a really poor interaction with an existing visibility bug. This reverts commit r213348. llvm-svn: 213395
* [modules] Fix macro hiding bug exposed if:Richard Smith2014-07-186-0/+16
| | | | | | | | | | | | | | * A submodule of module A is imported into module B * Another submodule of module A that is not imported into B exports a macro * Some submodule of module B also exports a definition of the macro, and happens to be the first submodule of B that imports module A. In this case, we would incorrectly determine that A's macro redefines B's macro, and so we don't need to re-export B's macro at all. This happens with the 'assert' macro in an LLVM self-host. =( llvm-svn: 213348
* [modules] When merging a class template, also merge the definition of its ↵Richard Smith2014-07-112-0/+12
| | | | | | pattern. llvm-svn: 212836
* [modules] Don't try to merge template specializations by performing name lookupRichard Smith2014-07-113-2/+10
| | | | | | | | | into their container; we won't find them there. These things are already being merged when they're added to their primary template's folding set, so this merging is redundant (and causes us to reject-valid because we think we've found an odr violation). llvm-svn: 212788
* [modules] When we merge redecl chains or mark a decl used with an updateRichard Smith2014-06-163-0/+8
| | | | | | | record, mark all subsequent decls as 'used' too, to maintain the AST invariant that getPreviousDecl()->Used implies this->Used. llvm-svn: 211050
* When merging functions across modules (and in particular, instantiations ofRichard Smith2014-05-293-0/+17
| | | | | | | member functions), ensure that the redecl chain never transitions from 'inline' to 'not inline', since that violates an AST invariant. llvm-svn: 209794
* [modules] If a referenced-but-not-instantiated class template specializationRichard Smith2014-05-232-0/+10
| | | | | | | | | | gets explicitly specialized, don't reuse the previous class template specialization declaration as a new declaration. The benefit here is fairly marginal, it harms source fidelity, and this is horrible to model if the specialization was imported from another module (without this change, it asserts or worse). llvm-svn: 209552
* If a class template specialization from one module has its definitionRichard Smith2014-05-222-0/+9
| | | | | | | | | instantiated in another module, and the instantiation uses a partial specialization, include the partial specialization and its template arguments in the update record. We'll need them if someone imports the second module and tries to instantiate a member of the template. llvm-svn: 209472
* If two sibling modules declare the same entity, and we indirectly pull aRichard Smith2014-05-193-0/+32
| | | | | | | | declaration of that entity in from one of those modules, keep track of the fact that we've not completed the redeclaration chain yet so that we can pull the remaining declarations in from the other module if they're needed. llvm-svn: 209161
* Add missed file from r209046.Richard Smith2014-05-161-0/+5
| | | | llvm-svn: 209047
* If a declaration is loaded, and then a module import adds a redeclaration, thenRichard Smith2014-05-162-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ensure that querying the first declaration for its most recent declaration checks for redeclarations from the imported module. This works as follows: * The 'most recent' pointer on a canonical declaration grows a pointer to the external AST source and a generation number (space- and time-optimized for the case where there is no external source). * Each time the 'most recent' pointer is queried, if it has an external source, we check whether it's up to date, and update it if not. * The ancillary data stored on the canonical declaration is allocated lazily to avoid filling it in for declarations that end up being non-canonical. We'll still perform a redundant (ASTContext) allocation if someone asks for the most recent declaration from a decl before setPreviousDecl is called, but such cases are probably all bugs, and are now easy to find. Some finessing is still in order here -- in particular, we use a very general mechanism for handling the DefinitionData pointer on CXXRecordData, and a more targeted approach would be more compact. Also, the MayHaveOutOfDateDef mechanism should now be expunged, since it was addressing only a corner of the full problem space here. That's not covered by this patch. Early performance benchmarks show that this makes no measurable difference to Clang performance without modules enabled (and fixes a major correctness issue with modules enabled). I'll revert if a full performance comparison shows any problems. llvm-svn: 209046
* Push implicitly-declared allocation functions into the IdResolver. Otherwise,Richard Smith2014-05-161-0/+2
| | | | | | | declaration merging in modules is unable to find them and we get bogus errors and even crashes. llvm-svn: 208944
* If an instantiation of a template is required to be a complete type, checkRichard Smith2014-05-072-0/+9
| | | | | | | whether the definition of the template is visible rather than checking whether the instantiated definition happens to be in an imported module. llvm-svn: 208150
* Add -Wnon-modular-include* optionsBen Langmuir2014-05-0528-0/+60
| | | | | | | | | | | | 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
* Defer loading any pending update records until we've finished deserializing.Richard Smith2014-04-302-0/+7
| | | | | | | This fixes a bug where an update record causes us to load an entity that refers to an entity we've not finished loading yet, resulting in badness. llvm-svn: 207603
* If we see an explicit instantiation declaration or definition of a functionRichard Smith2014-04-242-0/+14
| | | | | | | | | | | | | 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-242-0/+4
| | | | | | | | | | | | | | 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
* Initial implementation of -modules-earch-all option, for searching for ↵John Thompson2014-04-234-0/+27
| | | | | | 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-195-0/+24
| | | | | | 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-181-0/+8
| | | | | | | | 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-171-0/+15
| | | | 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
* Allow multiple modules with the same name to coexist in the module cacheBen Langmuir2014-04-146-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* If a header is explicitly included in module A, and excluded from an umbrellaRichard Smith2014-04-084-0/+6
| | | | | | directory in module B, don't include it in module B! llvm-svn: 205762
* Save out a correct lookup table if a lookup table entry is stale (it containsRichard Smith2014-03-252-0/+9
| | | | | | | | | 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
OpenPOWER on IntegriCloud