summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [modules] Stop updating all identifiers when writing a module. This isRichard Smith2015-08-241-1/+7
| | | | | | | unnecessary in C++ modules (where we don't need the identifiers for their Decls) and expensive. llvm-svn: 245821
* [modules] Rearrange how redeclaration chains are loaded, to remove a walk overRichard Smith2015-08-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | all modules and reduce the number of declarations we load when loading a redeclaration chain. The new approach is: * when loading the first declaration of an entity within a module file, we first load all declarations of the entity that were imported into that module file, and then load all the other declarations of that entity from that module file and build a suitable decl chain from them * when loading any other declaration of an entity, we first load the first declaration from the same module file As before, we complete redecl chains through name lookup where necessary. To make this work, I also had to change the way that template specializations are stored -- it no longer suffices to track only canonical specializations; we now emit all "first local" declarations when emitting a list of specializations for a template. On one testcase with several thousand imported module files, this reduces the total runtime by 72%. llvm-svn: 245779
* [modules] Tests for r245390.Richard Smith2015-08-185-0/+21
| | | | llvm-svn: 245391
* [modules] When parsing the base specifiers of a parse-merged class, the currentRichard Smith2015-08-174-14/+27
| | | | | | | | context is the class itself but lookups should be performed starting with the lookup parent of the class (class and base members don't shadow types from the surrounding context because they have not been declared yet). llvm-svn: 245236
* [modules] PR20507: Avoid silent textual inclusion.Sean Silva2015-08-1711-3/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If a module was unavailable (either a missing requirement on the module being imported, or a missing file anywhere in the top-level module (and not dominated by an unsatisfied `requires`)), we would silently treat inclusions as textual. This would cause all manner of crazy and confusing errors (and would also silently "work" sometimes, making the problem difficult to track down). I'm really not a fan of the `M->isAvailable(getLangOpts(), getTargetInfo(), Requirement, MissingHeader)` function; it seems to do too many things at once, but for now I've done things in a sort of awkward way. The changes to test/Modules/Inputs/declare-use/module.map were necessitated because the thing that was meant to be tested there (introduced in r197805) was predicated on silently falling back to textual inclusion, which we no longer do. The changes to test/Modules/Inputs/macro-reexport/module.modulemap are just an overlooked missing header that seems to have been missing since this code was committed (r213922), which is now caught. Reviewers: rsmith, benlangmuir, djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10423 llvm-svn: 245228
* [modules] When explicitly building a module file, don't include timestamps inRichard Smith2015-08-172-1/+5
| | | | | | | the produced pcm file for stable file creation across distributed build systems. llvm-svn: 245199
* [modules] Stop dropping 'module.timestamp' files into the current directoryRichard Smith2015-08-151-0/+14
| | | | | | when building with implicit modules disabled. llvm-svn: 245136
* Don't run explicit-modules-missing-files.cpp on WindowsReid Kleckner2015-08-141-0/+3
| | | | | | | | | | | It is flaky due to inability to remove files with open handles. We could paper over it with rm -f, but then the file would still be present. This is more evidence to me that we should roll our own 'rm' implementation in LLVM. llvm-svn: 245083
* [modules] Add an experimental -cc1 feature to embed the contents of an inputRichard Smith2015-08-141-6/+17
| | | | | | | | | | | file in the .pcm files. This allows a smaller set of files to be sent to a remote build worker when building with explicit modules (for instance, module map files need not be sent along with the corresponding precompiled modules). This doesn't actually make the embedded files visible to header search, so it's not useful as a packaging format for public header files. llvm-svn: 245028
* [modules] When writing a module file built with -fmodule-map-file-home-is-cwd,Richard Smith2015-08-131-6/+14
| | | | | | | | via a module map found by -fmodule-map-file=, the home directory of the module is the current working directory, even if that's a different directory on reload. llvm-svn: 244988
* [modules] For explicit module file dependencies, only list direct dependency ↵Richard Smith2015-08-131-0/+7
| | | | | | module files. llvm-svn: 244931
* Fix wrong expected test output in r244923.Richard Smith2015-08-131-2/+2
| | | | llvm-svn: 244927
* [modules] Change the way we deal with .d output for explicitly-specified moduleRichard Smith2015-08-131-14/+7
| | | | | | | | | | | | | files: include the .pcm file itself in the .d output, rather than including its own input files. Other forms of module file continue to be transparent for .d output. Arguably, the input files for the .pcm file are still inputs to the compilation, but that's unnecessary for make-like build systems (where the mtime of the .pcm file is sufficient) and harmful for smarter build systems that know about module files and want to track only the local dependencies. llvm-svn: 244923
* [Modules] Add Darwin-specific compatibility module map parsing hacksBen Langmuir2015-08-134-0/+48
| | | | | | | | | | | | | | | | This preserves backwards compatibility for two hacks in the Darwin system module map files: 1. The use of 'requires excluded' to make headers non-modular, which should really be mapped to 'textual' now that we have this feature. 2. Silently removes a bogus cplusplus requirement from IOKit.avc. Once we start diagnosing missing requirements and headers on auto-imports these would have broken compatibility with existing Darwin SDKs. llvm-svn: 244912
* [modules] Fix thread safety analysis to cope with merging of FieldDecls ↵Richard Smith2015-08-125-0/+43
| | | | | | across modules. llvm-svn: 244714
* [modules] When instantiating the contents of an imported CXXRecordDecl, we canRichard Smith2015-08-113-0/+7
| | | | | | | | emit lexical contents for a declaration for another module. Track which module those contents came from, and ensure that we only grab the lexical contents from a single such instantiation. llvm-svn: 244682
* [modules] Don't suggest deleting the module cache on an error if there is no ↵Richard Smith2015-08-111-0/+1
| | | | | | module cache for this build. llvm-svn: 244547
* [modules] Properly diagnose errors in module files for which we have noRichard Smith2015-08-111-1/+12
| | | | | | corresponding include location (those specified on the command line). llvm-svn: 244538
* clang/test/Modules: Satisfy win32 hosts due to dospath issue.NAKAMURA Takumi2015-08-093-3/+3
| | | | llvm-svn: 244427
* [modules] PR22534: Load files specified by -fmodule-file= eagerly. In ↵Richard Smith2015-08-095-14/+58
| | | | | | particular, this avoids the need to re-parse module map files when using such a module. llvm-svn: 244416
* Unrevert r244412 (reverted in r244414), and delete the bogus line left behindRichard Smith2015-08-091-4/+6
| | | | | | in the unit test that was checking a file the test no longer creates. llvm-svn: 244415
* Revert "[modules] Don't leak -M flags for dependency file generation into ↵Justin Bogner2015-08-091-6/+3
| | | | | | | | | | | | | | | the module" This was failing tests on a bunch of bots: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/29919/steps/check-all http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/29627/steps/check-all http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/9959/ http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/5591/ This reverts r244412 llvm-svn: 244414
* [modules] When building a dependency file, include module maps parsed in theRichard Smith2015-08-094-7/+18
| | | | | | current compilation, not just those from imported modules. llvm-svn: 244413
* [modules] Don't leak -M flags for dependency file generation into the moduleRichard Smith2015-08-091-3/+6
| | | | | | | | | | build process when we implicitly build a module. Previously, we'd create the specified .d file once for each implicitly-built module and then finally overwrite it with the correct contents after the requested build completes. (This fails if you use stdout as a dependency file, which is what the provided testcase does, and is how I discovered this brokenness.) llvm-svn: 244412
* Add file missed from r244409.Richard Smith2015-08-091-0/+9
| | | | llvm-svn: 244410
* [modules] When loading a template specialization, re-canonicalize its templateRichard Smith2015-08-094-0/+30
| | | | | | | | arguments because the reloaded form might have become non-canonical across the serialization/deserialization step (this particularly happens when the canonical form of the type involves an expression). llvm-svn: 244409
* Make 'arm' cover both 32 and 64 bit architecutresBen Langmuir2015-08-073-0/+80
| | | | | | | | | | | | | | | | ... and add aarch32 to specifically refer to the 32-bit ones. Previously, 'arm' meant only 32-bit architectures and there was no way for a module to build with both 32 and 64 bit ARM architectures. Now a module that is intended to work on both architectures can specify requires arm whereas a module only for 32-bit platforms can say requires aarch32 and just like before, 64-bit only can say requires aarch64 llvm-svn: 244306
* [modules] Make IndirectFieldDecl mergeable to avoid lookup ambiguity when ↵Richard Smith2015-08-042-0/+9
| | | | | | the same anonymous union is defined across multiple modules. llvm-svn: 243940
* [modules] Fix issue where building a module from a relative path when ↵Argyrios Kyrtzidis2015-07-313-0/+16
| | | | | | | | | -working-directory option is set, results in error. The error was "module '<name>' was built in directory '<path>' but now resides in directory '<path>' rdar://21330027 llvm-svn: 243718
* Add fmodules-cache-path to 2 tests which were missing it.Pete Cooper2015-07-302-1/+11
| | | | | | | | | | These tests were creating a modules.idx file in my clang checkout, not the build directory or temp. All the other tests in this directory use -fmodules-cache-path=%t so updated these to match. llvm-svn: 243657
* Enable accidentally-disabled tests.Sean Silva2015-07-301-2/+2
| | | | | | | I think I was isolating the failure in the last RUN: line during development, and forgot to re-enable the others. llvm-svn: 243624
* Avoid failure to canonicalize '..'.Sean Silva2015-07-303-0/+14
| | | | | | | | | | | | | | Also fix completely broken and untested code which was hiding the primary bug. The !LLVM_ON_UNIX branch of the ifdef was actually a no-op. I ran into this in the wild. It was causing failures in our SDK build. Ideally we'd have a perfect llvm::sys::fs::canonical, but at least this is a step in the right direction, and fixes an obviously broken case. In some sense the test case I've added here is an integration test. We should have these routines thoroughly unit tested in llvm::sys::fs. llvm-svn: 243597
* [modules] When performing redeclaration lookup for a using declaration, preferRichard Smith2015-07-296-0/+27
| | | | | | | | | | UsingShadowDecls over other declarations of the same entity in the lookup results. This ensures that we build correct redeclaration chains for the UsingShadowDecls (otherwise we could see assertions and other misbehavior in modules builds, when merging combines multiple redeclaration chains for the same entity from the same module into one chain). llvm-svn: 243592
* [modules] Change module manager visitation order to be a bit more stable whenRichard Smith2015-07-221-3/+8
| | | | | | | | | | | more modules are added: visit modules depth-first rather than breadth-first. The visitation is still (approximately) oldest-to-newest, and still guarantees that a module is visited before anything it imports, so modules that are imported by others sometimes need to jump to a later position in the visitation order when more modules are loaded, but independent module trees don't interfere with each other any more. llvm-svn: 242863
* [modules] In C++, stop serializing and deserializing a list of declarations inRichard Smith2015-07-211-4/+0
| | | | | | | | | the identifier table. This is redundant, since the TU-scope lookups are also serialized as part of the TU DeclContext, and wasteful in a number of ways. We still emit the decls for PCH / preamble builds, since for those we want identical results, not merely semantically equivalent ones. llvm-svn: 242855
* [modules] Produce an error if -cc1 wants to implicitly build a module and noRichard Smith2015-07-211-0/+5
| | | | | | | module cache has been provided, rather than creating one in the current directory. llvm-svn: 242819
* Attempt to fix greendragon buildbot failures; apparently wc sometimes ↵Richard Smith2015-07-201-2/+2
| | | | | | inserts a leading space into its output. Just check for a matching number anywhere in the output. llvm-svn: 242661
* [modules] Add (already passing) test for template default argument merging ↵Richard Smith2015-07-193-3/+14
| | | | | | when the template is declared in a namespace. llvm-svn: 242653
* [modules] Don't save uninteresting identifiers, and don't consider identifiersRichard Smith2015-07-191-0/+6
| | | | | | | to be interesting just because they are the name of a builtin. Reduces the size of an empty module by over 80% (~100KB). llvm-svn: 242650
* Make the clang module container format selectable from the command line.Adrian Prantl2015-07-171-4/+7
| | | | | | | | | | | | | - introduces a new cc1 option -fmodule-format=[raw,obj] with 'raw' being the default - supports arbitrary module container formats that libclang is agnostic to - adds the format to the module hash to avoid collisions - splits the old PCHContainerOperations into PCHContainerWriter and a PCHContainerReader. Thanks to Richard Smith for reviewing this patch! llvm-svn: 242499
* [Sema] Emit a better diagnostic when variable redeclarations disagreeDavid Majnemer2015-07-141-2/+2
| | | | | | | | | | | We referred to all declaration in definitions in our diagnostic messages which is can be inaccurate. Instead, classify the declaration and emit an appropriate diagnostic for the new declaration and an appropriate note pointing to the old one. This fixes PR24116. llvm-svn: 242190
* Add file missed from r242105.Richard Smith2015-07-141-0/+3
| | | | llvm-svn: 242109
* [modules] When diagnosing errors in module map files found by 'extern ↵Richard Smith2015-07-142-0/+5
| | | | | | module' declarations, show how we got to that module map file. llvm-svn: 242105
* [Modules] Allow missing header before a missing requirementBen Langmuir2015-07-132-0/+15
| | | | | | | | | | | And make the module unavailable without breaking any parent modules. If there's a missing requirement after we've already seen a missing header, still update the IsMissingRequiement bit correctly. Also, diagnose missing requirements before missing headers, since the existence of the header is moot if there are missing requirements. llvm-svn: 242055
* [modules] When checking the include guard for a header, check whether it'sRichard Smith2015-07-106-0/+15
| | | | | | | | | | visible in the module we're considering entering. Previously we assumed that if we knew the include guard for a modular header, we'd already parsed it, but that need not be the case if a header is present in the current module and one of its dependencies; the result of getting this wrong was that the current module's submodule for the header would end up empty. llvm-svn: 241953
* [modules] Fix "prefer own module over others" rule when selecting a module ↵Richard Smith2015-07-101-2/+2
| | | | | | for a header to work in the presence of module hierarchy. llvm-svn: 241936
* [modules] Fix merging support for forward-declared enums with fixed ↵Richard Smith2015-07-082-0/+8
| | | | | | underlying types. A visible declaration is enough to make the type complete, but not enough to make the definition visible. llvm-svn: 241743
* [modules] Fix crash when writing an update record for a redeclaration of an ↵Richard Smith2015-07-083-0/+6
| | | | | | empty namespace. llvm-svn: 241732
* [modules] When determining the visible module set during templateRichard Smith2015-07-084-0/+22
| | | | | | | instantiation, use the set of modules visible from the template definition, not from whichever declaration the specialization was instantiated from. llvm-svn: 241662
* Revert "Revert r241620 and follow-up commits" and move the initializationAdrian Prantl2015-07-0810-5/+26
| | | | | | of the llvm targets from clang/CodeGen into ClangCheck.cpp and CIndex.cpp. llvm-svn: 241653
OpenPOWER on IntegriCloud