summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* PR29166: when merging declarations with typedef names for linkage purposes,Richard Smith2016-08-301-0/+1
| | | | | | | don't assume that the anonymous struct will be part of the most recent declaration of the typedef. llvm-svn: 280136
* Fix a bug preventing the cause for a module file-not-found from being displayedAdrian Prantl2016-08-291-1/+1
| | | | llvm-svn: 280010
* Fix a bug preventing the cause of a module-out-of-date error from being printedAdrian Prantl2016-08-291-1/+1
| | | | llvm-svn: 280009
* Lazily load the ContextDecl for a lambda's DefinitionData, to fix aRichard Smith2016-08-251-0/+22
| | | | | | | deserialization cycle caused by the ContextDecl recursively importing members of the lambda's closure type. llvm-svn: 279694
* Fix regression introduced by r279164: only pass definitions as the PatternDefRichard Smith2016-08-233-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | to DiagnoseUninstantiableTemplate, teach hasVisibleDefinition to correctly determine whether a function definition is visible, and mark both the function and the template as visible when merging function template definitions to provide hasVisibleDefinition with the relevant information. The change to always pass the right declaration as the PatternDef to DiagnoseUninstantiableTemplate also caused those checks to happen before other diagnostics in InstantiateFunctionDefinition, giving worse diagnostics for the same situations, so I sunk the relevant diagnostics into DiagnoseUninstantiableTemplate. Those parts of this patch are based on changes in reviews.llvm.org/D23492 by Vassil Vassilev. This reinstates r279486, reverted in r279500, with a fix to DiagnoseUninstantiableTemplate to only mark uninstantiable explicit instantiation declarations as invalid if we actually diagnosed them. (When we trigger an explicit instantiation of a class member from an explicit instantiation declaration for the class, it's OK if there is no corresponding definition and we certainly don't want to mark the member invalid in that case.) This previously caused a build failure during bootstrap. llvm-svn: 279557
* Revert r279486 "Fix regression introduced by r279164"Chandler Carruth2016-08-233-5/+2
| | | | | | | Build bots seem unhappy and as Richard was leaving he asked me to revert this for him. Doing so. llvm-svn: 279500
* Typo.Adrian Prantl2016-08-221-1/+1
| | | | llvm-svn: 279491
* Add the second half of the testcase I should have added in 279485.Adrian Prantl2016-08-221-0/+18
| | | | llvm-svn: 279489
* Fix regression introduced by r279164: only pass definitions as the PatternDefRichard Smith2016-08-223-2/+5
| | | | | | | | | | | | | | | | to DiagnoseUninstantiableTemplate, teach hasVisibleDefinition to correctly determine whether a function definition is visible, and mark both the function and the template as visible when merging function template definitions to provide hasVisibleDefinition with the relevant information. The change to always pass the right declaration as the PatternDef to DiagnoseUninstantiableTemplate also caused those checks to happen before other diagnostics in InstantiateFunctionDefinition, giving worse diagnostics for the same situations, so I sunk the relevant diagnostics into DiagnoseUninstantiableTemplate. Those parts of this patch are based on changes in reviews.llvm.org/D23492 by Vassil Vassilev. llvm-svn: 279486
* Module debug info: Don't assert when encountering an incomplete definitionAdrian Prantl2016-08-223-0/+25
| | | | | | | | | | in isDefinedInClangModule() and assume that the incomplete definition is not defined in the module. This broke the -gmodules self host recently. rdar://problem/27894367 llvm-svn: 279485
* clang/test/Modules/prebuilt-module.m: Prune "-triple" to fix a configuration ↵NAKAMURA Takumi2016-08-191-1/+1
| | | | | | mismatch. llvm-svn: 279207
* PR28794: Don't try to instantiate function templates which are not visible.Vassil Vassilev2016-08-184-0/+28
| | | | | | Reviewed by Richard Smith. llvm-svn: 279164
* Module: add -fprebuilt-module-path to support loading prebuilt modules.Manman Ren2016-08-183-0/+12
| | | | | | | | | | | | | In this mode, there is no need to load any module map and the programmer can simply use "@import" syntax to load the module directly from a prebuilt module path. When loading from prebuilt module path, we don't support rebuilding of the module files and we ignore compatible configuration mismatches. rdar://27290316 Differential Revision: http://reviews.llvm.org/D23125 llvm-svn: 279096
* Remove debugging aids from this test and fix its expectations.Richard Smith2016-08-181-3/+1
| | | | llvm-svn: 279034
* PR28438: Update the information on an identifier with local definitions beforeRichard Smith2016-08-185-0/+14
| | | | | | | | trying to write out its macro graph, in case we imported a module that added another module macro between the most recent local definition and the end of the module. llvm-svn: 279024
* Print the module format in clang -module-file-info.Adrian Prantl2016-08-171-0/+4
| | | | llvm-svn: 279005
* Support object-file-wrapped modules in clang -module-file-info.Adrian Prantl2016-08-171-2/+5
| | | | | | rdar://problem/24504815 llvm-svn: 279004
* Module debug info: Fix a bug in handling record decls without fields.Adrian Prantl2016-08-173-2/+39
| | | | | | | | | | | The previous condition would erroneously mark all CXXRecordDecls that didn't have any fields as being defined in a clang module. This patch fixes the condition to only apply to explicit template instantiations. <rdar://problem/27771823> llvm-svn: 278952
* [VFS] Add 'ignore-non-existent-contents' field to YAML filesBruno Cardoso Lopes2016-08-121-0/+1
| | | | | | | | | | | | | | | | | | Add 'ignore-non-existent-contents' to tell the VFS whether an invalid path obtained via 'external-contents' should cause iteration on the VFS to stop. If 'true', the VFS should ignore the entry and continue with the next. Allows YAML files to be shared across multiple compiler invocations regardless of prior existent paths in 'external-contents'. This global value is overridable on a per-file basis. This adds the parsing and write test part, but use by VFS comes next. Differential Revision: https://reviews.llvm.org/D23422 rdar://problem/27531549 llvm-svn: 278456
* [clang/test] Fix a flaky unittest on windowsEtienne Bergeron2016-08-031-4/+10
| | | | | | | | | | | | | | | | | | | | Summary: The append operator on a shell command for quick command-line is causing trouble on windows. [NFC] The easiest way to fix them is to avoid using them. This patch is an attempt to fix this broken build bot: clang-x86-win2008-selfhost http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/9523 Reviewers: rnk Subscribers: cfe-commits, chrisha Differential Revision: https://reviews.llvm.org/D23105 llvm-svn: 277576
* Modules: add command line option fmodules-disable-diagnostic-validationManman Ren2016-07-264-0/+18
| | | | | | | | | | | | | | | | | | | | | | With PCH+Module, sometimes compiler gives a hard error: Module file ‘<some-file path>.pcm' is out of date and needs to be rebuilt This happens when we have a pch importing a module and the module gets overwritten by another compiler instance after we build the pch (one example is that both compiler instances hash to the same pcm file but use different diagnostic options). When we try to load the pch later on, the compiler notices that the imported module is out of date (modification date, size do not match) but it can't handle this out of date pcm (i.e it does not know how to rebuild the pch). This commit introduces a new command line option so for PCH + module, we can turn on this option and if two compiler instances only differ in diagnostic options, the latter instance will not invalidate the original pcm. rdar://26675801 Differential Revision: http://reviews.llvm.org/D22773 llvm-svn: 276769
* [modules] Teach the ASTWriter to ignore mutations coming from the ASTReader.Vassil Vassilev2016-07-226-0/+31
| | | | | | | | | | | | | | | Processing update records (and loading a module, in general) might trigger unexpected calls to the ASTWriter (being a mutation listener). Now we have a mechanism to suppress those calls to the ASTWriter but notify other possible mutation listeners. Fixes https://llvm.org/bugs/show_bug.cgi?id=28332 Patch by Cristina Cristescu and me. Reviewed by Richard Smith (D21800). llvm-svn: 276473
* Add regression test for PR27699.Vassil Vassilev2016-07-225-0/+19
| | | | llvm-svn: 276469
* Disable a flaky test on Windows that uses "echo >>"Reid Kleckner2016-07-211-0/+5
| | | | llvm-svn: 276335
* Reroll "Include unreferenced nested types in member list only for CodeView"Adrian McCarthy2016-07-211-1/+1
| | | | | | Another attempt at r276271, hopefully without breaking ModuleDebugInfo test. llvm-svn: 276317
* Revert "Include unreferenced nested types in member list only for CodeView"Adrian McCarthy2016-07-211-5/+1
| | | | | | | | | | Patch broke ModuleDebugInfo test on the build bots (but not locally). Again. svn revision: r276271 This reverts commit 9da8a1b05362bc96f2855fb32b5588b89407685d. llvm-svn: 276279
* Include unreferenced nested types in member list only for CodeViewAdrian McCarthy2016-07-211-1/+5
| | | | | | Unreferenced nested structs and classes were omitted from the debug info. In DWARF, this was intentional, to avoid bloat. But for CodeView, we want this information to be consistent with what Microsoft tools would produce and expect. llvm-svn: 276271
* [modules] Don't emit initializers for VarDecls within a module eagerly wheneverRichard Smith2016-07-208-8/+53
| | | | | | | | | | | | we first touch any part of that module. Instead, defer them until the first time that module is (transitively) imported. The initializer step for a module then recursively initializes modules that its own headers imported. For example, this avoids running the <iostream> global initializer in programs that don't actually use iostreams, but do use other parts of the standard library. llvm-svn: 276159
* Revert r275481, r275490. This broke modules bootstrap.Richard Smith2016-07-156-44/+0
| | | | llvm-svn: 275624
* Push alias-declarations and alias-template declarations into scope even ifRichard Smith2016-07-151-0/+7
| | | | | | | | they're redeclarations. This is necessary in order for name lookup to correctly find the most recent declaration of the name (which affects default template argument lookup and cross-module merging, among other things). llvm-svn: 275612
* Add test inputs missed by r275481.Richard Smith2016-07-145-0/+8
| | | | llvm-svn: 275490
* [modules] Don't pass interesting decls to the consumer for a module file that'sRichard Smith2016-07-141-0/+36
| | | | | | | | | | | passed on the command line but never actually used. We consider a (top-level) module to be used if any part of it is imported, either by the current translation unit, or by any part of a top-level module that is itself used. (Put another way, a module is used if an implicit modules build would have loaded its .pcm file.) llvm-svn: 275481
* Restructure the propagation of -fPIC/-fPIE.Rafael Espindola2016-06-231-1/+1
| | | | | | | | | | | | | The PIC and PIE levels are not independent. In fact, if PIE is defined it is always the same as PIC. This is clear in the driver where ParsePICArgs returns a PIC level and a IsPIE boolean. Unfortunately that is currently lost and we pass two redundant levels down the pipeline. This patch keeps a bool and a PIC level all the way down to codegen. llvm-svn: 273566
* [modules] Allow emission of update records for predefined __va_list_tag.Vassil Vassilev2016-06-203-0/+19
| | | | | | | | | | | Handles the cases where old __va_list_tag is coming from a module and the new is not, needing an update record. Fixes https://llvm.org/bugs/show_bug.cgi?id=27890 Patch by Cristina Cristescu, Richard Smith and me. llvm-svn: 273159
* Redirect unused output in test to /dev/nullRichard Trieu2016-06-091-3/+3
| | | | | | | Discard unused output so when the test fails, it only prints information that is helpful about the failure. No functional change. llvm-svn: 272325
* PCH + module: make sure we write out macros associated with builtin identifiers.Manman Ren2016-05-314-0/+22
| | | | | | | | | | | | | | | | | | | | | | When we import a module that defines a builtin identifier from prefix header and precompile the prefix header, the macro information related to the identifier is lost. If we don't precompile the prefix header, the source file can still see the macro information. The reason is that we write out the identifier in the pch but not the macro information since the macro is not defined locally. This is related to r251565. In that commit, if we read a builtin identifier from a module that wasn't "interesting" to that module, we will still write it out to a PCH that imports that module. The fix is to write exported module macros for PCH as well. rdar://24666630 Differential Revision: http://reviews.llvm.org/D20383 llvm-svn: 271310
* [modules] Ask the canonical decl whether the constructor was defaulted.Vassil Vassilev2016-05-245-0/+54
| | | | | | | | | | | In case of template instantiations query the template instantiation pattern, which had actually '=default'. Fixes https://llvm.org/bugs/show_bug.cgi?id=27739 Patch reviewed by Richard Smith. llvm-svn: 270553
* PR27754: CXXRecordDecl::data() needs to perform an update even if it's calledRichard Smith2016-05-176-0/+22
| | | | | | on a declaration that already knows the location of the DefinitionData object. llvm-svn: 269858
* Modules: set SystemHeader to true if we are building a system module.Manman Ren2016-05-175-0/+33
| | | | | | | | | | | | If we are processing a #include from a module build, we should treat it as a system header if we're building a system module. Passing an optional flag to HeaderSearch::LookupFile. Before this, the testing case will crash when accessing a freed FileEntry. rdar://26214027 llvm-svn: 269730
* [Modules] Use vfs for (recursive) directory iterationBruno Cardoso Lopes2016-05-161-0/+13
| | | | | | | | | | | | | | | | Clang performs directory walk while searching headers inside modules by using the ::sys::fs instead of ::vfs. This prevents any code that uses the VFS (e.g, reproducer scripts) to actually find such headers, since the VFS will never be searched for those. Change these places to use vfs::recursive_directory_iterator and vfs::directory_iterator instead. Differential Revision: http://reviews.llvm.org/D20266 rdar://problem/25880368 llvm-svn: 269661
* [ModuleMap][CrashReproducer] Collect headers from inner frameworksBruno Cardoso Lopes2016-05-137-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (1) Collect headers under inner frameworks (frameworks inside other other frameworks). (2) Make sure we also collect the right header files inside them. More info on (2): Consider a dummy framework module B, with header Frameworks/B/B.h. Now consider that another framework A, with header Frameworks/A/A.h, has a layout with a inner framework Frameworks/A/Frameworks/B/B.h, where the "B/B.h" part is a symlink for Frameworks/B/B.h. Also assume that Frameworks/A/A.h includes <B/B.h>. When parsing header Frameworks/A/A.h, framework module lookup is performed in search for B, and it happens that "Frameworks/A/Frameworks/B/B.h" path is registered in the module instead of real "Frameworks/B/B.h". This occurs because "Frameworks/A/Frameworks/B/B.h" is scanned first by the FileManager, when looking for inner framework modules under Frameworks/A/Frameworks. This makes Frameworks/A/Frameworks/B/B.h the default cached named inside the FileManager for the B.h file UID. This leads to modules being built without consistent paths to underlying header files. This is usually not a problem in regular compilation flow, but it's an issue when running the crash reproducer. The issue is that clangs collect "Frameworks/A/Frameworks/B/B.h" but not "Frameworks/B/B.h" into the VFS, leading to err_mmap_umbrella_clash. So make sure we also collect the original header. Differential Revision: http://reviews.llvm.org/D20194 rdar://problem/25880368 llvm-svn: 269502
* [CrashReproducer] Always use realpath for destinationBruno Cardoso Lopes2016-05-061-9/+1
| | | | | | | | | | When running reproducer scripts we need that original symlinks from the source filesystem are reproduced in the VFS so that different virtual paths can map to the same file, allowing the FileManager to share the same UID between these virtual entries. This avoids all sorts of module redefinition errors when using frameworks. llvm-svn: 268825
* [modules] Enforce the rules that an explicit or partial specialization must beRichard Smith2016-05-054-6/+126
| | | | | | | | declared before it is used. Because we don't use normal name lookup to find these, the normal code to filter out non-visible names from name lookup results does not apply. llvm-svn: 268585
* Fix CodeCompletion & TypoCorrection when combining a PCH with ModulesBen Langmuir2016-05-043-0/+16
| | | | | | | | | | | | | | This commit fixes the IdentifierIterator to actually include identifiers from a PCH or precompiled preamble when there is also a global module index. This was causing code-completion (outside of C++) and typo-correction to be missing global identifiers defined in the PCH/preamble. Typo-correction has been broken since we first started using the module index, whereas code-completion only started relying on identifier iterator in r232793. rdar://problem/25642879 llvm-svn: 268471
* [modules][debuginfo] Only include imported modules when targeting LLDBDavid Blaikie2016-05-034-5/+17
| | | | | | | | | | | | | | | | | These constructs are only applicable to a debugger capable of loading a Clang AST, so omit them for brevity when not doing so. We could potentially propagate more of CodeGenOptions through the ObjectFilePCGContainerOperations for consistency (so the next person who adds some CodeGenOpts feature that tweaks debug info output doesn't get caught by this), so I'm open to objections/alternatives there, but went with this for now. Tested just a couple of basic cases (one direct, one indirect (through the ObjectFilePCHContainerOperations) & fixed up other cases to pass the -debugger-tuning flag as appropriate. llvm-svn: 268460
* Adding a test for a compiler crash that was fixed in r248069.Douglas Yung2016-05-033-0/+13
| | | | | | Differential Revision: http://reviews.llvm.org/D19048 llvm-svn: 268344
* Method Pool in modules: we make sure that if a module contains an entry forManman Ren2016-04-296-0/+43
| | | | | | | | | | | | | | | a selector, the entry should be complete, containing everything introduced by that module and all modules it imports. Before writing out the method pool of a module, we sync up the out of date selectors by pulling in methods for the selectors, from all modules it imports. In ReadMethodPool, after pulling in the method pool entry for module A, this lets us skip the modules that module A imports. rdar://problem/25900131 llvm-svn: 268091
* Reland r267691 fixing PR27535.Vassil Vassilev2016-04-284-0/+77
| | | | llvm-svn: 267882
* [modules] When diagnosing a missing module import, suggest adding a #include ifRichard Smith2016-04-2718-0/+72
| | | | | | | the current language doesn't have an import syntax and we can figure out a suitable file to include. llvm-svn: 267802
* Revert r267691, it caused PR27535.Nico Weber2016-04-274-77/+0
| | | | llvm-svn: 267744
OpenPOWER on IntegriCloud