summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/Inputs
Commit message (Collapse)AuthorAgeFilesLines
* [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
* [modules] Generalize the workaround for multiple ambiguous definitions ofRichard Smith2015-11-042-0/+2
| | | | | | | | | | | | | internal linkage entities in different modules from r250884 to apply to all names, not just function names. This is really awkward: we don't want to merge internal-linkage symbols from separate modules, because they might not actually be defining the same entity. But we don't want to reject programs that use such an ambiguous symbol if those internal-linkage symbols are in fact equivalent. For now, we're resolving the ambiguity by picking one of the equivalent definitions as an extension. llvm-svn: 252063
* Introduce module file extensions to piggy-back data onto module files.Douglas Gregor2015-11-032-0/+5
| | | | | | | | | | | | | | | | | | | | | Introduce the notion of a module file extension, which introduces additional information into a module file at the time it is built that can then be queried when the module file is read. Module file extensions are identified by a block name (which must be unique to the extension) and can write any bitstream records into their own extension block within the module file. When a module file is loaded, any extension blocks are matched up with module file extension readers, that are per-module-file and are given access to the input bitstream. Note that module file extensions can only be introduced by programmatic clients that have access to the CompilerInvocation. There is only one such extension at the moment, which is used for testing the module file extension harness. As a future direction, one could imagine allowing the plugin mechanism to introduce new module file extensions. llvm-svn: 251955
* [modules] Rationalize the behavior of Decl::declarationReplaces, and inRichard Smith2015-11-035-0/+18
| | | | | | | | | particular don't assume that two declarations of the same kind in the same context are declaring the same entity. That's not true when the same name is declared multiple times as internal-linkage symbols within a module. (getCanonicalDecl is cheap now, so we can just use it here.) llvm-svn: 251898
* Fix missing builtin identifier infos with PCH+modulesBen Langmuir2015-10-282-0/+3
| | | | | | | | | | | | | | Use the *current* state of "is-moduleness" rather than the state at serialization time so that 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. Otherwise, we would get mysterious "unknown builtin" errors when using PCH+modules. rdar://problem/23287656 llvm-svn: 251565
* Module Debugging: Emit module debug info for types inside of Objective-CAdrian Prantl2015-10-231-0/+10
| | | | | | | | containers. rdar://problem/23196170 llvm-svn: 251120
* [modules] libstdc++ defines some static inline functions in its internalRichard Smith2015-10-215-0/+21
| | | | | | | | | | | headers. If those headers end up being textually included twice into the same module, we get ambiguity errors. Work around this by downgrading the ambiguity error to a warning if multiple identical internal-linkage functions appear in an overload set, and just pick one of those functions as the lookup result. llvm-svn: 250884
* [modules] Fix merging of __va_list_tag's implicit special member functions.Richard Smith2015-10-134-0/+18
| | | | | | | | | | | We model predefined declarations as not being from AST files, but in most ways they act as if they come from some implicit prebuilt module file imported before all others. Therefore, if we see an update to the predefined 'struct __va_list_tag' declaration (and we've already loaded any modules), it needs a corresponding update record, even though it didn't technically come from an AST file. llvm-svn: 250134
* Module debugging: Don't emit forward declarations in module scopes.Adrian Prantl2015-10-021-0/+1
| | | | | | A forward declaration inside a module header does not belong to the module. llvm-svn: 249157
* Module debugging: Also emit Objective-C interfaces forward declarationsAdrian Prantl2015-10-011-0/+2
| | | | | | in their module scope when building a clang module. llvm-svn: 249031
* Module debugging: Support submodules in the PCM/PCH debug info.Adrian Prantl2015-09-203-0/+17
| | | | llvm-svn: 248127
* [Modules] More descriptive diagnostics for misplaced import directiveSerge Pavlov2015-09-193-0/+14
| | | | | | | | | | If an import directive was put into wrong context, the error message was obscure, complaining on misbalanced braces. To get more descriptive messages, annotation tokens related to modules are processed where they must not be seen. Differential Revision: http://reviews.llvm.org/D11844 llvm-svn: 248085
* [modules] Make sure we make hidden UsingShadowDecls visible to redeclarationRichard Smith2015-09-152-0/+2
| | | | | | lookup for the UsingShadowDecls themselves. llvm-svn: 247714
* [modules] A using-declaration doesn't introduce a new entity, just a new nameRichard Smith2015-09-151-0/+26
| | | | | | | for an existing entity, and as such a using-declaration doesn't need to conflict with a hidden entity (nor vice versa). llvm-svn: 247654
* Add new test file missing from r247486.Richard Smith2015-09-111-0/+6
| | | | llvm-svn: 247488
* [modules] When picking one of two template declarations as a lookup result,Richard Smith2015-09-112-0/+7
| | | | | | | | it's not sufficient to prefer the declaration with more default arguments, or the one that's visible; they might both be visible, but one of them might have a visible default argument where the other has a hidden default argument. llvm-svn: 247486
* Module Debugging: Emit debug type information into clang ObjC modules.Adrian Prantl2015-09-083-5/+15
| | | | | | | | | | When -fmodule-format is set to "obj", emit debug info for all types declared in a module or referenced by a declaration into the module's object file container. This patch adds support for Objective-C types and methods. llvm-svn: 247068
* Module Debugging: Emit debug type information into clang modules.Adrian Prantl2015-09-082-0/+56
| | | | | | | | | | When -fmodule-format is set to "obj", emit debug info for all types declared in a module or referenced by a declaration into the module's object file container. This patch adds support for C and C++ types. llvm-svn: 247049
* [modules] Tests for r245390.Richard Smith2015-08-184-0/+7
| | | | llvm-svn: 245391
* [modules] When parsing the base specifiers of a parse-merged class, the currentRichard Smith2015-08-172-0/+10
| | | | | | | | 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-179-3/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] Add Darwin-specific compatibility module map parsing hacksBen Langmuir2015-08-133-0/+26
| | | | | | | | | | | | | | | | 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-124-0/+25
| | | | | | across modules. llvm-svn: 244714
* [modules] When instantiating the contents of an imported CXXRecordDecl, we canRichard Smith2015-08-112-0/+5
| | | | | | | | 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
* 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-093-0/+18
| | | | | | | | 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-071-0/+13
| | | | | | | | | | | | | | | | ... 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-041-0/+8
| | | | | | 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-312-0/+7
| | | | | | | | | -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
* Avoid failure to canonicalize '..'.Sean Silva2015-07-302-0/+5
| | | | | | | | | | | | | | 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-295-0/+16
| | | | | | | | | | 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] Add (already passing) test for template default argument merging ↵Richard Smith2015-07-192-0/+4
| | | | | | when the template is declared in a namespace. llvm-svn: 242653
* 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-141-0/+2
| | | | | | module' declarations, show how we got to that module map file. llvm-svn: 242105
* [Modules] Allow missing header before a missing requirementBen Langmuir2015-07-131-0/+11
| | | | | | | | | | | 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-105-0/+10
| | | | | | | | | | 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-081-0/+3
| | | | | | 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-083-0/+18
| | | | | | | instantiation, use the set of modules visible from the template definition, not from whichever declaration the specialization was instantiated from. llvm-svn: 241662
* [Modules] Be consistent about finding a module for framework headersBen Langmuir2015-07-027-0/+22
| | | | | | | | | | | | | | | | We use findModuleForHeader() in several places, but in header search we were not calling it when a framework module didn't show up with the expected name, which would then lead to unexpected non-modular includes. Now we will find the module unconditionally for frameworks. For regular frameworks, we use the spelling of the module name from the module map file, and for inferred ones we use the canonical directory name. In the future we might want to lock down framework modules sufficiently that these name mismatches cannot happen. rdar://problem/20465870 llvm-svn: 241258
* [modules] Merging support for specializations of a function template. This veryRichard Smith2015-07-011-0/+8
| | | | | | | rarely matters, but can affect whether two dependent types are canonically equivalent. llvm-svn: 241207
* [modules] Don't make out-of-line member specializations of an instantiatedRichard Smith2015-07-011-1/+3
| | | | | | | class template specialization visible just because the class template specialization's definition is visible. llvm-svn: 241182
* [modules] Skip trailing attributes when skipping a class definition during ↵Richard Smith2015-07-011-0/+4
| | | | | | parse-merging. llvm-svn: 241180
* [modules] Don't require the 'inline' specifier when merging an inline function;Richard Smith2015-07-011-0/+6
| | | | | | any source of the inline nature is sufficient. llvm-svn: 241146
OpenPOWER on IntegriCloud