summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/Inputs
Commit message (Collapse)AuthorAgeFilesLines
* Adding a test for a compiler crash that was fixed in r248069.Douglas Yung2016-05-032-0/+4
| | | | | | 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-295-0/+32
| | | | | | | | | | | | | | | 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-283-0/+39
| | | | llvm-svn: 267882
* [modules] When diagnosing a missing module import, suggest adding a #include ifRichard Smith2016-04-2717-0/+39
| | | | | | | 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-273-39/+0
| | | | llvm-svn: 267744
* [modules] Fix Decl's Used invariant.Vassil Vassilev2016-04-273-0/+39
| | | | | | | | | | | | | | | | | | | | The Decl::isUsed has a value for every decl. In non-module builds it is very difficult (but possible) to break this invariant but when we walk up the redecl chain we find the neccessary information. When deserializing the decls from a module it is much more difficult to update correctly this invariant. The patch centralizes the information whether a decl is used in the canonical decl marking the entire entity as being used. Fixes https://llvm.org/bugs/show_bug.cgi?id=27401 Patch by Cristina Cristescu and me. Thanks to Richard Smith who helped to debug and understand the issue! Reviewed by Richard Smith. llvm-svn: 267691
* PR27513: When determining which declaration to put into an exported lookupRichard Smith2016-04-2611-0/+33
| | | | | | | | | | | table for a module / PCH, never map from a normal declaration of a class to an injected-class-name declaration (or vice versa). Those declarations live in distinct lookup tables and should not be confused. We really shouldn't be using a CXXRecordDecl to represent an injected-class-name in the first place; I've filed PR27532 so we don't forget. llvm-svn: 267632
* Module debugging: Also correctly handle typedef'd foward-declared members.Adrian Prantl2016-04-261-4/+5
| | | | | | Thanks again to Richard Smith for pointing this out. llvm-svn: 267630
* Module debugging: Add testcase for member classes of class template ↵Adrian Prantl2016-04-261-0/+9
| | | | | | specializations. llvm-svn: 267612
* Module Debugging: Fix the condition for determining whether a templateAdrian Prantl2016-04-251-1/+13
| | | | | | | | | | | | | | | | | | instantiation is in a module. This patch fixes the condition for determining whether the debug info for a template instantiation will exist in an imported clang module by: - checking whether the ClassTemplateSpecializationDecl is complete and - checking that the instantiation was in a module by looking at the first field. I also added a negative check to make sure that a typedef to a forward-declared template (with the definition outside of the module) is handled correctly. http://reviews.llvm.org/D19443 rdar://problem/25553724 llvm-svn: 267464
* Module Debugging: Emit the canonical debug info for Objective-C classesAdrian Prantl2016-04-201-0/+6
| | | | | | | | | | | | | in the compile unit that contains their implementation even if their interface is declared in a module. The private @implementation of an @interface may have additional hidden ivars so we should not defer to the public version of the type that is found in the module. <rdar://problem/25541798> llvm-svn: 266937
* Fix off-by-one error in worst-case number of offsets needed for an AST record.Richard Smith2016-04-141-0/+5
| | | | llvm-svn: 266353
* PR25501: Delay loading visible updates for a declaration until after we'veRichard Smith2016-04-086-0/+16
| | | | | | | | | | | processed update records. If an update record adds a definition, we need to merge that with any pre-existing definition to determine which the canonical definition is before we apply the visible update, otherwise we wouldn't know where to apply it. Thanks to Vassil Vassilev for help reducing this and tracking down the problem. llvm-svn: 265848
* [modules] Handle merged fields in designated initializers.Richard Smith2016-04-081-0/+4
| | | | llvm-svn: 265838
* [modules] Add forgotten test case to r265597.Vassil Vassilev2016-04-064-0/+9
| | | | llvm-svn: 265599
* [VFS] Handle empty entries in directory traversalBruno Cardoso Lopes2016-03-304-0/+13
| | | | | | | | | | | | | The VFS YAML files contain empty directory entries to describe that it's returning from a subdirectory before describing new files in the parent. In the future, we should properly sort and write YAML files avoiding such empty dirs and mitigate the extra recurson cost. However, since this is used by previous existing YAMLs, make the traversal work in their presence. rdar://problem/24499339 llvm-svn: 264970
* Canonicalize UnaryTransformType types when they don't have a known ↵Vassil Vassilev2016-03-303-0/+32
| | | | | | | | | | underlying type. Fixes https://llvm.org/bugs/show_bug.cgi?id=26014 Reviewed by Richard Smith. llvm-svn: 264937
* [modules] Write out identifiers if the ID is local, too.Vassil Vassilev2016-03-304-0/+7
| | | | | | | | | | | | | | | | | In some cases a slot for an identifier is requested but it gets written to another module, causing an assertion. At the point when we start serializing Rtypes, we have no imported IdentifierID for float_round_style. We start serializing stuff and allocate an ID for it. Then, during the serialization process, we pull in the identifier info for it from TSchemaHelper. Finally, WriteIdentifierTable decides that the identifier has not changed since it was deserialized, so doesn't emit it. Fixes https://llvm.org/bugs/show_bug.cgi?id=27041 Discussed on IRC with Richard Smith. Agreed on post commit review if needed. llvm-svn: 264913
* [modules] Add a regression test for PR21547.Vassil Vassilev2016-03-302-0/+17
| | | | llvm-svn: 264908
* Use a simpler set of mock headers for the vfs+modules crash recovery tests.Benjamin Kramer2016-03-173-0/+11
| | | | | | | | | | The System/ mock is large and too complex for this test. It can cause the tests to fail in mysterious ways as it depends on the resource dir being present, which is not really supported for driver tests (using %clang instead of %clang_cc1). Copy the tree and trim out all the %unnecessary fat. llvm-svn: 263718
* [modules] Fix adding a templated friend functions to a namespace from ↵Vassil Vassilev2016-03-163-0/+49
| | | | | | | | | | | | | | another module. When clang adds argument dependent lookup candidates, it can perform template instantiation. For example, it can instantiate a templated friend function and register it in the enclosing namespace's lookup table. Fixes https://llvm.org/bugs/show_bug.cgi?id=24954 Reviewed by Richard Smith. llvm-svn: 263634
* [modules] Don't diagnose non-modular includes from modular files that areRichard Smith2016-03-141-0/+4
| | | | | | implementation units of modules rather than interface units. llvm-svn: 263449
* Module Debugging: Fix a crash when emitting debug info for nested tag typesAdrian Prantl2016-03-071-0/+11
| | | | | | | | whose DeclContext is not yet complete by deferring their emission. rdar://problem/24918680 llvm-svn: 262851
* [modules] Prefer more complete array types.Vassil Vassilev2016-02-283-5/+0
| | | | | | | | | | | | | | If we import a module that has a complete array type and one that has an incomplete array type, the declaration found by name lookup might be the one with the incomplete type, possibly resulting in rejects-valid. Now, the name lookup prefers decls with a complete array types. Also, diagnose cases when the redecl chain has array bound, different from the merge candidate. Reviewed by Richard Smith. llvm-svn: 262189
* [modules] Flatten -fmodule-name= and -fmodule-implementation-of= into a singleRichard Smith2016-02-191-1/+1
| | | | | | | | | | | | option. Previously these options could both be used to specify that you were compiling the implementation file of a module, with a different set of minor bugs in each case. This change removes -fmodule-implementation-of, and instead tracks a flag to determine whether we're currently building a module. -fmodule-name now behaves the same way that -fmodule-implementation-of previously did. llvm-svn: 261372
* Don't synthesize an ImportDecl for a module named in -fmodule-implementation-ofBen Langmuir2016-02-051-0/+1
| | | | | | | | | | When building a PCH with modules enabled this import would assert in the ASTWriter and (if assertions were disabled) sometimes crash the compiler that loaded the resulting PCH when trying to lookup the submodule ID. rdar://problem/24137448 llvm-svn: 259859
* Fix predefine for __NSConstantString struct typeBen Langmuir2016-02-041-3/+0
| | | | | | | | | | | | | | | | | Per review feedback the name was wrong and it can be used outside Objective-C. Unfortunately, making the internal struct visible broke some ASTMatchers tests that assumed that the first record decl would be from user code, rather than a builtin type. I'm worried that this will also affect users' code. So this patch adds a typedef to wrap the internal struct and only makes the typedef visible to namelookup. This is sufficient to allow the ASTReader to merge the decls we need without making the struct itself visible. rdar://problem/24425801 llvm-svn: 259734
* Reapply r259624, it is likely not the commit causing the bot failures.Quentin Colombet2016-02-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original message: Make CF constant string decl visible to name lookup to fix module errors The return type of the __builtin___*StringMakeConstantString functions is a pointer to a struct, so we need that struct to be visible to name lookup so that we will correctly merge multiple declarations of that type if they come from different modules. Incidentally, to make this visible to name lookup we need to rename the type to __NSConstantString, since the real NSConstantString is an Objective-C interface type. This shouldn't affect anyone outside the compiler since users of the constant string builtins cast the result immediately to CFStringRef. Since this struct type is otherwise implicitly created by the AST context and cannot access namelookup, we make this a predefined type and initialize it in Sema. Note: this issue of builtins that refer to types not visible to name lookup technically also affects other builtins (e.g. objc_msgSendSuper), but in all other cases the builtin is a library builtin and the issue goes away if you include the library that defines the types it uses, unlike for these constant string builtins. rdar://problem/24425801 llvm-svn: 259721
* Revert r259624 - Make CF constant string decl visible to name lookup to fix ↵Quentin Colombet2016-02-031-7/+0
| | | | | | | | | module errors. This breaks some internal bots in stage2: clang seg fault. Looking with Ben to see what is going on. llvm-svn: 259715
* Make CF constant string decl visible to name lookup to fix module errorsBen Langmuir2016-02-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The return type of the __builtin___*StringMakeConstantString functions is a pointer to a struct, so we need that struct to be visible to name lookup so that we will correctly merge multiple declarations of that type if they come from different modules. Incidentally, to make this visible to name lookup we need to rename the type to __NSConstantString, since the real NSConstantString is an Objective-C interface type. This shouldn't affect anyone outside the compiler since users of the constant string builtins cast the result immediately to CFStringRef. Since this struct type is otherwise implicitly created by the AST context and cannot access namelookup, we make this a predefined type and initialize it in Sema. Note: this issue of builtins that refer to types not visible to name lookup technically also affects other builtins (e.g. objc_msgSendSuper), but in all other cases the builtin is a library builtin and the issue goes away if you include the library that defines the types it uses, unlike for these constant string builtins. rdar://problem/24425801 llvm-svn: 259624
* Merge templated static member variables, fixes http://llvm.org/pr26179.Yaron Keren2016-01-224-0/+29
| | | | | | | Patch by Vassil Vassilev! Reviewed by Richard Smith. llvm-svn: 258524
* Module Debugging: Fine-tune the condition that determines whether a typeAdrian Prantl2016-01-201-0/+6
| | | | | | | | | | | | | can be found in a module. There are externally visible anonymous types that can be found: typedef struct { } s; // I can be found via the typedef. There are anonymous internal types that can be found: namespace { struct s {}; } // I can be found by name. rdar://problem/24199640 llvm-svn: 258272
* Module Debugging: Add Objective-C testcases for anonymous tag decls. (NFC)Adrian Prantl2016-01-191-0/+14
| | | | | | rdar://problem/24199640 llvm-svn: 258252
* Module Debugging: Make sure that anonymous tag decls that define globalAdrian Prantl2016-01-191-0/+4
| | | | | | | | | variables are visited. This shouldn't encourage anyone to put global variables into clang modules. rdar://problem/24199640 llvm-svn: 258250
* Module Debugging: Defer the emission of anonymous tag declsAdrian Prantl2016-01-191-0/+4
| | | | | | | | | | | | | until we are visiting their declcontext. This fixes a regression introduced in r256962: When building debug info for a typdef'd anonymous tag type, we would be visiting the inner anonymous type first thus creating a "typedef changes linkage of anonymous type, but linkage was already computed" error. rdar://problem/24199640 llvm-svn: 258152
* [modules] Don't diagnose a conflict between two using-declarations that name ↵Richard Smith2016-01-123-3/+6
| | | | | | equivalent internal linkage entities. llvm-svn: 257512
* Module debugging: Add a testcase for standalone forward declarations.Adrian Prantl2016-01-091-0/+2
| | | | llvm-svn: 257241
* [modules] Make sure we always include the contents of private headers whenRichard Smith2016-01-081-1/+3
| | | | | | | | | | building a module. Prior to this change, the private header's content would only be included if the header were included by another header in the same module. If not (if the private header is only used by the .cc files of the module, or is included from outside the module via -Wno-private-header), a #include of that file would be silently ignored. llvm-svn: 257222
* Fix a typo.Adrian Prantl2016-01-061-1/+1
| | | | llvm-svn: 256963
* Module debugging: Defer emitting tag types until their definitionAdrian Prantl2016-01-061-0/+6
| | | | | | | | | was visited and all decls have been merged. We only get a single chance to emit the types for virtual classes because CGDebugInfo::completeRequiredType() categorically doesn't complete them. llvm-svn: 256962
* Allow non-defining declarations of class template partial specializations toRichard Smith2015-12-111-0/+7
| | | | | | | | | have a nested name specifier. Strictly speaking, forward declarations of class template partial specializations are not permitted at all, but that seems like an obvious wording defect, and if we allow them without a nested name specifier we should also allow them with a nested name specifier. llvm-svn: 255383
* Reapply "[Modules] Fix regression when an elaborated-type-specifier mentions ↵Ben Langmuir2015-12-112-0/+10
| | | | | | | | | a hidden tag" Now not trying to use a C++ lookup mechanism in C (d'oh). Unqualified lookup is actually fine for this case in C. llvm-svn: 255377
* Revert "[Modules] Fix regression when an elaborated-type-specifier mentions ↵Ben Langmuir2015-12-112-10/+0
| | | | | | | | | | a hidden tag" This is causing assertion failures; reverting until I can fix. This reverts commit r255267 llvm-svn: 255324
* [Modules] Fix regression when an elaborated-type-specifier mentions a hidden tagBen Langmuir2015-12-102-0/+10
| | | | | | | | | This makes non-C++ languages find the same decl as C++ does to workaround a regression introduced in r252960. rdar://problem/23784203 llvm-svn: 255267
* [modules] Fix some more cases where we used to reject a conflict between twoRichard Smith2015-11-171-0/+6
| | | | | | | declarations that are not simultaneously visible, and where at least one of them has internal/no linkage. llvm-svn: 253283
* [modules] Allow "redefinition" of typedef of anon tag from unimported submoduleBen Langmuir2015-11-143-0/+9
| | | | | | | | | r233345 started being stricter about typedef names for linkage purposes in non-visible modules, but broke languages without the ODR. rdar://23527954 llvm-svn: 253123
* Fix auto-link for text-based dynamic library SDKs.Juergen Ributzka2015-11-132-0/+2
| | | | | | | | | | When linking against text-based dynamic library SDKs the library name of a framework has now more than one possible filename extensions. This fix tests for both possible extensions (none, and .tbd). This fixes rdar://problem/20609975 llvm-svn: 253060
* [modules] Follow the C++ standard's rule for linkage of enumerators: they haveRichard Smith2015-11-131-1/+0
| | | | | | | | | the linkage of the enumeration. For enumerators of unnamed enumerations, extend the -Wmodules-ambiguous-internal-linkage extension to allow selecting an arbitrary enumerator (but only if they all have the same value, otherwise it's ambiguous). llvm-svn: 253010
* [modules] Simplify and generalize the existing rule for finding hiddenRichard Smith2015-11-123-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | declarations in redeclaration lookup. A declaration is now visible to lookup if: * It is visible (not in a module, or in an imported module), or * We're doing redeclaration lookup and it's externally-visible, or * We're doing typo correction and looking for unimported decls. We now support multiple modules having different internal-linkage or no-linkage definitions of the same name for all entities, not just for functions, variables, and some typedefs. As previously, if multiple such entities are visible, any attempt to use them will result in an ambiguity error. This patch fixes the linkage calculation for a number of entities where we previously didn't need to get it right (using-declarations, namespace aliases, and so on). It also classifies enumerators as always having no linkage, which is a slight deviation from the C++ standard's definition, but not an observable change outside modules (this change is being discussed on the -core reflector currently). This also removes the prior special case for tag lookup, which made some cases of this work, but also led to bizarre, bogus "must use 'struct' to refer to type 'Foo' in this scope" diagnostics in C++. llvm-svn: 252960
* Allow use of private headers in different sub-modules.Manuel Klimek2015-11-052-0/+18
| | | | llvm-svn: 252170
OpenPOWER on IntegriCloud