summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/Inputs
Commit message (Collapse)AuthorAgeFilesLines
...
* [modules] When using -E, we may try to merge decls despite having no SemaRichard Smith2015-02-043-0/+6
| | | | | | | | | | | object. In such a case, use the TU's DC for merging global decls rather than giving up when we find there is no TU scope. Ultimately, we should probably avoid all loading of decls when preprocessing, but there are other reasonable use cases for loading an AST file with no Sema object for which this is the right thing. llvm-svn: 228234
* Add missing file from r228104.Richard Smith2015-02-041-0/+2
| | | | llvm-svn: 228105
* [modules] If we already have a fake definition for one declaration of a class,Richard Smith2015-02-047-9/+27
| | | | | | | don't think we're providing a new one in an update record adding a definition to another declaration of the same class. llvm-svn: 228104
* [modules] Be sure to load the lexical definition of a class templateRichard Smith2015-02-034-0/+33
| | | | | | | specialization from an update record exactly once, even if we needed to fake up the definition. llvm-svn: 227939
* Add cc1 option '-fmodule-feature' to add custom values for 'requires' declsBen Langmuir2015-02-021-0/+6
| | | | | | | This allows clang-based tools to specify custom features that can be tested by the 'requires' declaration in a module map file. llvm-svn: 227868
* [modules] When we try to complete the redeclaration chain for a class templateRichard Smith2015-01-313-0/+6
| | | | | | specialization, pull in any lazy specializations of the class template. llvm-svn: 227668
* [modules] Sometimes we can deserialize a class member but not have yetRichard Smith2015-01-245-0/+23
| | | | | | | | | | | encountered any definition for the class; this happens when the definition is added by an update record that is not yet loaded. In such a case, eagerly pick the original parent of the member as the canonical definition of the class rather than muddling through with the canonical declaration (the latter can lead to us failing to merge properly later if the canonical definition turns out to be some other declaration). llvm-svn: 226977
* Reorganize test/Modules:Richard Smith2015-01-2219-0/+64
| | | | | | | * Put all input files under Inputs/, move corresponding tests into test/Modules. * Rename a modulemap test file to [...].modulemap, and teach lit that such files are tests. llvm-svn: 226875
* [modules] If we add an implicit special member to a class through an updateRichard Smith2015-01-224-0/+8
| | | | | | | | record, and that class declaration is not the canonical definition of the class, be sure to add the class to the list of classes that are consulted when we look up a special member in the canonical definition. llvm-svn: 226778
* [modules] If we load two declarations with typedef names for linkage purposesRichard Smith2015-01-223-0/+4
| | | | | | | on top of a local declaration of the same entity, we still need to remember that we loaded the first one or we may fail to merge the second one properly. llvm-svn: 226765
* [modules] It's possible to merge into the pattern of a class template before weRichard Smith2015-01-224-0/+15
| | | | | | | load the definition data from the declaration itself. In that case, merge properly; don't assume the prior definition is the same as our own. llvm-svn: 226761
* Fix compiler_builtins.m test to not rely on including system stdlib.h and ↵Hans Wennborg2015-01-222-0/+1
| | | | | | | | | | | | | | malloc.h Importing _Builtin_intrinsics.sse and avx would transitively pull in those headers, and the test would fail when building in an environment where they were not available on the include path. This fixes PR20995 for me. Differential Revision: http://reviews.llvm.org/D7112 llvm-svn: 226754
* Inherit attributes when infering a framework moduleBen Langmuir2015-01-132-0/+2
| | | | | | | | | | If a module map contains framework module * [extern_c] {} We will now infer [extern_c] on the inferred framework modules (we already inferred [system] as a special case). llvm-svn: 225803
* Fix bogus 'method is unavailable' errors with modulesBen Langmuir2015-01-125-0/+22
| | | | | | | | This just tweaks the fix from r224892 (which handled PCHs) to work with modules, where we will serialize each method individually and hence the hasMoreThanOneDecl bit needs to be updated as we add the methods. llvm-svn: 225659
* Remove unused test input.Nico Weber2014-12-231-5/+0
| | | | llvm-svn: 224784
* [modules] When constructing paths relative to a module, strip out /./ directoryRichard Smith2014-12-115-0/+37
| | | | | | | components. These sometimes get synthetically added, and we don't want -Ifoo and -I./foo to be treated fundamentally differently here. llvm-svn: 224055
* Reinstate r223753, reverted in r223759 due to breakage of clang-tools-extra.Richard Smith2014-12-104-0/+18
| | | | | | | | | | | | | | | | | Original commit message: [modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1. For files named by -fmodule-map-file=, and files found by 'extern module' directives, this flag specifies that we should resolve filenames relative to the current working directory rather than relative to the directory in which the module map file resides. This is aimed at fixing path handling, in particular for relative -I paths, when building modules that represent components of the current project (rather than libraries installed on the current system, which the current project has as dependencies, where we'd typically expect the module map files to be looked up implicitly). llvm-svn: 223913
* Revert "[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1."Duncan P. N. Exon Smith2014-12-094-18/+0
| | | | | | | | | | | | | This reverts commit r223753. It broke the Green Dragon build for a few hours: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/2259/ http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/2259/consoleFull#43901905849ba4694-19c4-4d7e-bec5-911270d8a58c I suspect `clang-tools-extra` just needs a follow-up for an API change, but I'm not the right one to look into it. llvm-svn: 223759
* [modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1.Richard Smith2014-12-094-0/+18
| | | | | | | | | | | | | For files named by -fmodule-map-file=, and files found by 'extern module' directives, this flag specifies that we should resolve filenames relative to the current working directory rather than relative to the directory in which the module map file resides. This is aimed at fixing path handling, in particular for relative -I paths, when building modules that represent components of the current project (rather than libraries installed on the current system, which the current project has as dependencies, where we'd typically expect the module map files to be looked up implicitly). llvm-svn: 223753
* Add some file content to avoid test failures on content-addressed file systems.Richard Smith2014-12-062-0/+2
| | | | llvm-svn: 223596
* [modules] If we import a module, and we've seen a module map that describes theRichard Smith2014-12-065-0/+6
| | | | | | | | | module, use the path from the module map file in preference to the path from the .pcm file when resolving relative paths in the .pcm file. This allows diagnostics (and .d output) to give relative paths if the module was found via a relative path. llvm-svn: 223577
* [modules] Support combining 'textual' with 'private'.Richard Smith2014-10-243-0/+14
| | | | llvm-svn: 220589
* Revert accidentally-committed files in r220460.Richard Smith2014-10-233-14/+0
| | | | llvm-svn: 220461
* Refactor implementation of 'exclude header'.Richard Smith2014-10-233-0/+14
| | | | | | | | | This was not a real header role, and was never exposed to clients of ModuleMap. Remove the enumeration value for it and track it as marking the header as 'known' rather than creating an extra KnownHeader entry that *every single* client ignores. llvm-svn: 220460
* Test files I forgot to svn add in r220448.Richard Smith2014-10-222-0/+16
| | | | llvm-svn: 220449
* [modules] Add support for 'textual header' directives.Richard Smith2014-10-221-0/+9
| | | | | | | | This allows a module to specify that it logically contains a file, but that said file is non-modular and intended for textual inclusion. This allows layering checks to work properly in the presence of such files. llvm-svn: 220448
* [modules] Initial support for explicitly loading .pcm files.Richard Smith2014-10-224-0/+22
| | | | | | | | | | | | | | | Implicit module builds are not well-suited to a lot of build systems. In particular, they fare badly in distributed build systems, and they lead to build artifacts that are not tracked as part of the usual dependency management process. This change allows explicitly-built module files (which are already supported through the -emit-module flag) to be explicitly loaded into a build, allowing build systems to opt to manage module builds and dependencies themselves. This is only the first step in supporting such configurations, and it should be considered experimental and subject to change or removal for now. llvm-svn: 220359
* [modules] When building an injected-class-name type, we may have to insert itRichard Smith2014-10-214-0/+21
| | | | | | into multiple merged classes' TypeForDecl slots. llvm-svn: 220331
* [modules] Add support for #include_next.Richard Smith2014-10-206-0/+10
| | | | | | | | | | | | #include_next interacts poorly with modules: it depends on where in the list of include paths the current file was found. Files covered by module maps are not found in include search paths when building the module (and are not found in include search paths when @importing the module either), so this isn't really meaningful. Instead, we fake up the result that #include_next *should* have given: find the first path that would have resulted in the given file being picked, and search from there onwards. llvm-svn: 220177
* PR21215: Support -fmodule-map-file being specified multiple times. SupportRichard Smith2014-10-173-1/+8
| | | | | | loading multiple module map files from the same directory. llvm-svn: 220020
* [modules] Merging for class-scope using-declarations.Richard Smith2014-10-143-0/+95
| | | | llvm-svn: 219657
* [modules] When instantiating a class member, don't expect to find the previousRichard Smith2014-10-112-0/+5
| | | | | | | declaration in the instantiation if the previous declaration came from another definition of the class template that got merged into the pattern definition. llvm-svn: 219552
* [modules] Delay loading the field declared with an anonymous tag declarationRichard Smith2014-10-102-0/+15
| | | | | | until after we've had a chance to merge that tag. llvm-svn: 219539
* Fix interaction of max_align_t and modules.Richard Smith2014-10-033-0/+14
| | | | | | | | | When building with modules enabled, we were defining max_align_t as a typedef for a different anonymous struct type each time it was included, resulting in an error if <stddef.h> is not covered by a module map and is included more than once in the same modules-enabled compilation of C11 or C++11 code. llvm-svn: 218931
* Reduce the PR20399 test case.David Blaikie2014-10-014-79/+30
| | | | | | | | | I couldn't get something /really/ obvious, and I imagine Richard Smith might be able to provide some text explaining the sequence of steps that's demonstrated by these files - but at least it's a bit simpler now. llvm-svn: 218840
* PR20399: Do not assert when adding an implicit member coming from a module atRichard Smith2014-09-305-0/+124
| | | | | | | | writing time. Patch by Vassil Vassilev! llvm-svn: 218651
* PR19692: Add (passing) regression test.Richard Smith2014-09-157-0/+18
| | | | llvm-svn: 217836
* Avoid a couple of assertions when preprocessing with modulesBen Langmuir2014-09-103-0/+5
| | | | | | | | | | | | | | | | 1. We were hitting the NextIsPrevious assertion because we were trying to merge decl chains that were independent of each other because we had no Sema object to allow them to find existing decls. This is fixed by delaying loading the "preloaded" decls until Sema is available. 2. We were trying to get identifier info from an annotation token, which asserts. The fix is to special-case the module annotations in the preprocessed output printer. Fixed in a single commit because when you hit 1 you almost invariably hit 2 as well. llvm-svn: 217550
* Fix PCHs that import more than one moduleBen Langmuir2014-09-081-0/+1
| | | | | | | We were passing < to std::unique, but it expects ==. Since the input is sorted, we were always trimming it to one entry. llvm-svn: 217402
* Add -Wunused-local-typedef, a warning that finds unused local typedefs.Nico Weber2014-09-062-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning warns on TypedefNameDecls -- typedefs and C++11 using aliases -- that are !isReferenced(). Since the isReferenced() bit on TypedefNameDecls wasn't used for anything before this warning it wasn't always set correctly, so this patch also adds a few missing MarkAnyDeclReferenced() calls in various places for TypedefNameDecls. This is made a bit complicated due to local typedefs possibly being used only after their local scope has closed. Consider: template <class T> void template_fun(T t) { typename T::Foo s3foo; // YYY (void)s3foo; } void template_fun_user() { struct Local { typedef int Foo; // XXX } p; template_fun(p); } Here the typedef in XXX is only used at end-of-translation unit, when YYY in template_fun() gets instantiated. To handle this, typedefs that are unused when their scope exits are added to a set of potentially unused typedefs, and that set gets checked at end-of-TU. Typedefs that are still unused at that point then get warned on. There's also serialization code for this set, so that the warning works with precompiled headers and modules. For modules, the warning is emitted when the module is built, for precompiled headers each time the header gets used. Finally, consider a function using C++14 auto return types to return a local type defined in a header: auto f() { struct S { typedef int a; }; return S(); } Here, the typedef escapes its local scope and could be used by only some translation units including the header. To not warn on this, add a RecursiveASTVisitor that marks all delcs on local types returned from auto functions as referenced. (Except if it's a function with internal linkage, or the decls are private and the local type has no friends -- in these cases, it _is_ safe to warn.) Several of the included testcases (most of the interesting ones) were provided by Richard Smith. (gcc's spelling -Wunused-local-typedefs is supported as an alias for this warning.) llvm-svn: 217298
* Fix r217275 to work without the need for standard headers being includedDavid Blaikie2014-09-052-4/+0
| | | | | | | | It seems (I guess) in ObjC that va_list is provided without the need for inclusions. I verified that with this change the test still crashes in the absence of the fix committed in r217275. llvm-svn: 217290
* Move the initialization of VAListTagName after InitializeSema()Ben Langmuir2014-09-053-0/+9
| | | | | | | | | | | | | | | | | | | | This innocuous statement to get the identifier info for __va_list_tag was causing an assertion failure: NextIsPrevious() && "decl became non-canonical unexpectedly" if the __va_list_tag identifier was found in a PCH in some circumstances, because it was looked up before the ASTReader had a Sema object to use to find existing decls to merge with. We could possibly move getting the identifier info even later, or make it lazy if we wanted to, but this seemed like the minimal change. Now why a PCH would have this identifier in the first place is a bit mysterious. This seems to be related to the global module index in some way, because when the test case is built without the global module index it will not emit an identifier for __va_list_tag into the PCH, but with the global module index it does. llvm-svn: 217275
* [modules] Make NamespaceAliasDecl redeclarable, as it should be. This fixesRichard Smith2014-09-032-0/+6
| | | | | | | merging of namespace aliases across modules and improves source fidelity. Incidentally also fixes PR20816. llvm-svn: 217103
* [modules] Use DeclContext::equals rather than == on DeclContext* whenRichard Smith2014-09-033-0/+12
| | | | | | | | | | determining whether a declaration is out of line, instead of assuming that the semantic and lexical DeclContext will be the same declaration whenever they're the same entity. This fixes behavior of declarations within merged classes and enums. llvm-svn: 217008
* [modules] Fix deserialization cycle when loading a tag declaration with a ↵Richard Smith2014-08-302-0/+16
| | | | | | typedef name for linkage purposes. When loading the type, delay loading its typedef until we've finished loading and merging the type. In its place, save out the name of the typedef, which we need for merging purposes. llvm-svn: 216806
* Add some missing test coverage for merging 'extern "C"' functions with modules.Richard Smith2014-08-294-0/+9
| | | | llvm-svn: 216796
* [modules] PR20786: add (already passing) regression test from the bug report.Richard Smith2014-08-285-0/+19
| | | | llvm-svn: 216683
* [modules] When completing the redecl chain for an anonymous declaration in aRichard Smith2014-08-285-2/+14
| | | | | | | merged context, pull in the lexical decls in that context, since one of them may complete the redecl chain. llvm-svn: 216652
* [modules] Number anonymous declarations that are lexically within mergeableRichard Smith2014-08-283-0/+11
| | | | | | contexts, so that we can merge them when we merge the surrounding context. llvm-svn: 216639
* [modules] Don't assert when merging virtual functions that override otherRichard Smith2014-08-262-0/+15
| | | | | | | functions. Also don't needlessly pull in non-canonical declarations of the overridden virtual functions. llvm-svn: 216503
OpenPOWER on IntegriCloud