summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* [modules] Don't try to merge template specializations by performing name lookupRichard Smith2014-07-114-2/+13
| | | | | | | | | 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
* Remove REQUIRES lines from portable testsAlp Toker2014-06-251-1/+0
| | | | | | These tests are target-independent and shouldn't ever be suppressed. llvm-svn: 211738
* Disable Modules/dependency-dump-dependent-module.m on win32 for now.NAKAMURA Takumi2014-06-201-0/+6
| | | | | | | | FIXME: This fails on win32 due to ERROR_FILENAME_EXCED_RANGE if the working directory is too deep. We should make Win32/Path.inc capable of long pathnames with '\\?\'. llvm-svn: 211363
* test: Just check the VFS when testing module-dependency-dumpJustin Bogner2014-06-192-21/+0
| | | | | | | Checking the filesystem seems to be a bit unreliable. Limit the tests to the VFS map for now. llvm-svn: 211310
* Frontend: Add a CC1 flag to dump module dependencies to a directoryJustin Bogner2014-06-192-0/+52
| | | | | | | | | | | | | | | | | | This adds the -module-dependency-dir to clang -cc1, which specifies a directory to copy all of a module's dependencies into in a form suitable to be used as a VFS using -ivfsoverlay with the generated vfs.yaml. This is useful for crashdumps that involve modules, so that the module dependencies will be intact when a crash report script is used to reproduce a problem on another machine. We currently encode the absolute path to the dump directory, due to limitations in the VFS system. Until we can handle relative paths in the VFS, users of the VFS map may need to run a simple search and replace in the file. llvm-svn: 211303
* Improve robustness of tests for module flags metadataOliver Stannard2014-06-191-2/+2
| | | | | | | Fix clang tests to not break if the ID numbers of module flags metadata nodes change. llvm-svn: 211276
* [modules] When we merge redecl chains or mark a decl used with an updateRichard Smith2014-06-164-0/+16
| | | | | | | record, mark all subsequent decls as 'used' too, to maintain the AST invariant that getPreviousDecl()->Used implies this->Used. llvm-svn: 211050
* allow optional signext attributeWill Schmidt2014-06-021-1/+1
| | | | | | | Allow the tests to succeed with tne signext (or other) attribute is present. The attributes show up for Power, but not for x86*, so need to be appropriately wildcarded. llvm-svn: 210050
* When merging functions across modules (and in particular, instantiations ofRichard Smith2014-05-294-0/+31
| | | | | | | member functions), ensure that the redecl chain never transitions from 'inline' to 'not inline', since that violates an AST invariant. llvm-svn: 209794
* Add 'nonnull' parameter or return attribute when producing an llvm pointer ↵Nick Lewycky2014-05-281-2/+2
| | | | | | type in a function type where the C++ type is a reference. Update the tests. llvm-svn: 209723
* Add a test that we don't store stale modtime in modulesBen Langmuir2014-05-271-0/+37
| | | | | | | | | | | The change from r209195 turned out to be important to avoid saving stale modification time/expected size information in a module file when there are 3 or more modules in a dependency chain and the bottom one is rebuilt. So add a test for that. rdar://problem/17038180 llvm-svn: 209682
* [modules] If a referenced-but-not-instantiated class template specializationRichard Smith2014-05-233-0/+11
| | | | | | | | | | 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-223-0/+11
| | | | | | | | | 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-194-3/+46
| | | | | | | | 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
* Fix use-after-free and spurious error during module loadBen Langmuir2014-05-191-0/+25
| | | | | | | | | | | | | | FileManager::invalidateCache is not safe to call when there may be existing references to the file. What module load failure needs is to refresh so stale stat() info isn't stored. This may be the last user of invalidateCache; I'll take a look and remove it if possible in a future commit. This caused a use-after-free error as well as a spurious error message that a module was "found in both 'X.pcm' and 'X.pcm'" in some cases. llvm-svn: 209138
* 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-164-13/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-162-0/+6
| | | | | | | declaration merging in modules is unable to find them and we get bogus errors and even crashes. llvm-svn: 208944
* Switch Wmodule-build to a remarkBen Langmuir2014-05-081-2/+2
| | | | | | | | | On reflection, this is better despite the missing command-line handling bits for remarks. Making this a remark makes it much clearer that this is purely informational and avoids the negative connotations of a 'warning'. llvm-svn: 208367
* Remove -Wnon-modular-includeBen Langmuir2014-05-081-12/+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
* If an instantiation of a template is required to be a complete type, checkRichard Smith2014-05-074-26/+31
| | | | | | | 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-0529-0/+155
| | | | | | | | | | | | 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
* Add -Wmodule-build to make it easy to see when modules are (re)builtBen Langmuir2014-05-051-0/+22
| | | | | | Warning is default ignore, and not in -Wall. llvm-svn: 207975
* Make module self-import an errorBen Langmuir2014-05-052-6/+11
| | | | | | | | Ideally, importing Foo.a from Foo.b would "do the right thing", but until it does, this patch makes it an error rather than allow it to silently be ignored. llvm-svn: 207948
* Defer loading any pending update records until we've finished deserializing.Richard Smith2014-04-303-0/+9
| | | | | | | 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
* [PCH/Modules] Don't tie TargetOptions::LinkerVersion to a module/PCH, it's a ↵Argyrios Kyrtzidis2014-04-291-1/+0
| | | | | | | | driver only thing and doesn't affect any language/preprocessor/etc. semantics. rdar://16714526 llvm-svn: 207570
* 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
OpenPOWER on IntegriCloud