summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Use -isystem rather than relying on -isysroot to work consistentlyDouglas Gregor2012-02-021-1/+1
| | | | llvm-svn: 149626
* Yet more data from failing buildbots...Douglas Gregor2012-02-021-1/+1
| | | | llvm-svn: 149624
* Drop -verify to get better diagnostics from failing buildbots. Plus, we ↵Douglas Gregor2012-02-021-1/+1
| | | | | | don't need it here llvm-svn: 149613
* Back out my heinous hack that tricked the module generation mechanismDouglas Gregor2012-02-026-16/+55
| | | | | | | | | | | | | | | | | | | | into using non-absolute system includes (<foo>)... ... and introduce another hack that is simultaneously more heineous and more effective. We whitelist Clang-supplied headers that augment or override system headers (such as float.h, stdarg.h, and tgmath.h). For these headers, Clang does not provide a module mapping. Instead, a system-supplied module map can refer to these headers in a system module, and Clang will look both in its own include directory and wherever the system-supplied module map suggests, then adds either or both headers. The end result is that Clang-supplied headers get merged into the system-supplied module for the C standard library. As a drive-by, fix up a few dependencies in the _Builtin_instrinsics module. llvm-svn: 149611
* test/Modules/compiler_builtins.m: Appease Cygwin to add -D__need_wint_t.NAKAMURA Takumi2012-02-011-1/+1
| | | | | | | | On Cygwin, at first, <stddef.h> is included without __need_wint_t. Next, <stddef.h> is included with __need_wint_t, though Modules feature would not process <stddef.h> twice. Then, wint_t is not found in system headers. llvm-svn: 149500
* test/Modules/compiler_builtins.m: Mark this as XFAIL:win32. MS limits.h ↵NAKAMURA Takumi2012-02-011-0/+2
| | | | | | provides size_t. llvm-svn: 149499
* Split compiler builtin module into "stdlib" builtins and "intrinsic"Douglas Gregor2012-01-311-4/+8
| | | | | | | | builds, and bring mm_alloc.h into the fold. Start playing some tricks with these builtin modules to mirror the include_next tricks that the headers already perform. llvm-svn: 149434
* Remove tgmath.h from the module map for now, because it currently causes aDouglas Gregor2012-01-301-3/+0
| | | | | | | cyclic module dependency due to its inclusion of math.h and complex.h. I'll take another shot at it later. llvm-svn: 149283
* Introduce TargetInfo::hasFeature() to query various feature names inDouglas Gregor2012-01-301-0/+8
| | | | | | | | | | | | | | each of the targets. Use this for module requirements, so that we can pin the availability of certain modules to certain target features, e.g., provide a module for xmmintrin.h only when SSE support is available. Use these feature names to provide a nearly-complete module map for Clang's built-in headers. Only mm_alloc.h and unwind.h are missing, and those two are fairly specialized at the moment. Finishes <rdar://problem/10710060>. llvm-svn: 149227
* Just disable the compiler-builtins module test on MSVC for nowDouglas Gregor2012-01-291-0/+3
| | | | llvm-svn: 149214
* Teach tgmath.h to only include <complex.h> if it's available.Douglas Gregor2012-01-291-2/+2
| | | | llvm-svn: 149213
* Try to get useful diagnostics out of the failing MSVC buildersDouglas Gregor2012-01-291-2/+2
| | | | llvm-svn: 149212
* Alternate fix to the modules failures that doesn't require us to tweak tgmath.hDouglas Gregor2012-01-291-1/+1
| | | | llvm-svn: 149210
* If there's no math.h, then tgmath.h should just be emptyDouglas Gregor2012-01-291-3/+2
| | | | llvm-svn: 149209
* Temporary disable the -verify on this test in the hope of getting some ↵Douglas Gregor2012-01-291-2/+3
| | | | | | useful output from the buildbots llvm-svn: 149208
* Introduce a module map for (some of) the compiler-suppliedDouglas Gregor2012-01-291-0/+12
| | | | | | | | headers. The remaining headers require more sophisticated requirements; they'll be handled separately. Part of <rdar://problem/10710060>. llvm-svn: 149206
* Test module lookup within a subdirectory of a normal include directory.Douglas Gregor2012-01-293-3/+10
| | | | llvm-svn: 149196
* Introduce module attributes into the module map grammar, along with aDouglas Gregor2012-01-272-1/+8
| | | | | | | | | | | | | single attribute ("system") that allows us to mark a module as being a "system" module. Each of the headers that makes up a system module is considered to be a system header, so that we (for example) suppress warnings there. If a module is being inferred for a framework, and that framework directory is within a system frameworks directory, infer it as a system framework. llvm-svn: 149143
* Reimplement (de-)serialization of Objective-C categories to eliminateDouglas Gregor2012-01-274-0/+28
| | | | | | | | | | | | | | the direct serialization of the linked-list structure. Instead, use a scheme similar to how we handle redeclarations, with redeclaration lists on the side. This addresses several issues: - In cases involving mixing and matching of many categories across many modules, the linked-list structure would not be consistent across different modules, and categories would get lost. - If a module is loaded after the class definition and its other categories have already been loaded, we wouldn't see any categories in the newly-loaded module. llvm-svn: 149112
* Whenever Sema attempts to look in the global method pool, try to loadDouglas Gregor2012-01-254-0/+57
| | | | | | | | | additional data from the external Sema source. This properly copes with modules that are imported after we have already searched in the global method pool for a given selector. For PCH, it's a slight pessimization to be fixed soon. llvm-svn: 148891
* When deserializing the definition of a C++ class/ObjC class/ObjCDouglas Gregor2012-01-153-0/+13
| | | | | | | | | | | | | | | protocol, record the definition pointer in the canonical declaration for that entity, and then propagate that definition pointer from the canonical declaration to all other deserialized declarations. This approach works well even when deserializing declarations that didn't know about the original definition, which can occur with modules. A nice bonus from this definition-deserialization approach is that we no longer need update records when a definition is added, because the redeclaration chains ensure that the if any declaration is loaded, the definition will also get loaded. llvm-svn: 148223
* (Implicit) parameters deserialized as part of a function type must notDouglas Gregor2012-01-132-0/+8
| | | | | | | get added to the identifier chains as part of deserialization, because they should not be visible to name lookup. llvm-svn: 148159
* When inferring a module for a framework, first determine whether thatDouglas Gregor2012-01-131-2/+2
| | | | | | | | | | | | | framework is actually a subframework within a top-level framework. If so, only infer a module for the top-level framework and then dig out the appropriate submodule. This helps us cope with an amusing subframeworks anti-pattern, where one uses -F <framework>/Frameworks to get direct include access to the subframeworks of a framework (which otherwise would not be permitted). llvm-svn: 148148
* Don't infer a submodule for a framework's private header, at least for now.Douglas Gregor2012-01-131-1/+1
| | | | llvm-svn: 148117
* When deserializing an anonymous namespace from a module, do not attachDouglas Gregor2012-01-094-0/+48
| | | | | | | | the anonymous namespace to its parent. Semantically, this means that the anonymous namespaces defined in one module are distinct from the anonymous namespaces defined in another module. llvm-svn: 147782
* Implement merging of namespace-scope declarations across modules, soDouglas Gregor2012-01-093-0/+37
| | | | | | | | | | that we can merge, for example, two occurrences of namespace N { void f(); } in two disjoint modules. llvm-svn: 147780
* Implement redeclaration merging for namespaces defined in distinctDouglas Gregor2012-01-093-0/+48
| | | | | | | | | modules. Teach name lookup into namespaces to search in each of the merged DeclContexts as well as the (now-primary) DeclContext. This supports the common case where two different modules put something into the same namespace. llvm-svn: 147778
* Always allow redefinition of typedefs when modules are enabled. ThisDouglas Gregor2012-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | is important because it's fairly common for headers (especially system headers) to want to provide only those typedefs needed for that particular header, based on some guard macro, e.g., #ifndef _SIZE_T #define _SIZE_T typedef long size_t; #endif which is repeated in a number of headers. The guard macro protects against duplicate definitions. However, this means that only the first occurrence of this pattern actually defines size_t, so the submodule corresponding to this header has the only visible definition. If a user then imports a different submodule from the same module, size_t will be known but not visible, and therefore cannot be used. By allowing redefinition of typedefs, each header that wants to define size_t can do so independently, so it will be available in the corresponding submodules. llvm-svn: 147775
* Switch NamespaceDecl from its own hand-rolled redeclaration chain overDouglas Gregor2012-01-075-0/+67
| | | | | | | | | | | | to Redeclarable<NamespaceDecl>, so that we benefit from the improveed redeclaration deserialization and merging logic provided by Redeclarable<T>. Otherwise, no functionality change. As a drive-by fix, collapse the "inline" bit into the low bit of the original namespace/anonymous namespace, saving 8 bytes per NamespaceDecl on x86_64. llvm-svn: 147729
* When inferring a submodule ID during module creation, look up theDouglas Gregor2012-01-062-4/+14
| | | | | | | | | | include stack to find the first file that is known to be part of the module. This copes with situations where the module map doesn't completely specify all of the headers that are involved in the module, which can come up when there are very strange #include_next chains (e.g., with weird compiler/stdlib headers like stdarg.h or float.h). llvm-svn: 147662
* When we're performing name lookup for a tag, we still allow ourselvesDouglas Gregor2012-01-052-2/+4
| | | | | | | | | | | | | | | | | | to see hidden declarations because every tag lookup is effectively a redeclaration lookup. For example, image that struct foo; is declared in a submodule that is known but hasn't been imported. If someone later writes struct foo *foo_p; then "struct foo" is either a reference or a redeclaration. To keep the redeclaration chains sound, we treat it like a redeclaration for name-lookup purposes. llvm-svn: 147588
* When generating includes for all of the headers we found in anDouglas Gregor2012-01-052-1/+7
| | | | | | | umbrella directory, skip includes for any headers that are part of an unavailable module. llvm-svn: 147572
* Implement declaration merging for variables in disjoint modules.Douglas Gregor2012-01-043-0/+32
| | | | llvm-svn: 147535
* Implement declaration merging for non-template functions fromDouglas Gregor2012-01-043-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | different modules. This implementation is a first approximation of what we want, using only the function type to determine equivalence. Later, we'll want to deal with some of the more subtle issues, including: - C allows a prototyped declaration and a non-prototyped declaration to be merged, which we should support - We may want to ignore the return type when merging, then complain if the return types differ. Or, we may want to leave it as it us, so that we only complain if overload resolution eventually fails. - C++ non-static member functions need to consider cv-qualifiers and ref-qualifiers. - Function templates need to consider the template parameters and return type. - Function template specializations will have special rules. - We can now (accidentally!) end up overloading in C, even without the "overloadable" attribute, and will need to detect this at some point. The actual detection of "is this an overload?" is implemented by Sema::IsOverload(), which will need to be moved into the AST library for re-use here. That will be a future refactor. llvm-svn: 147534
* Don't treat 'import' as a contextual keyword when we're in a caching lexer, ↵Douglas Gregor2012-01-041-0/+6
| | | | | | or when modules are disabled. llvm-svn: 147524
* Test "merging" of typedef types across distinct modules. At present,Douglas Gregor2012-01-033-0/+15
| | | | | | | | | | | | the AST reader doesn't actually perform a merge, because name lookup knows how to merge identical typedefs together. As part of this, teach C/Objective-C name lookup to return multiple results in all cases, rather than first digging through the attributes to see if the value is overloadable. This way, we'll catch ambiguous lookups in C/Objective-C. llvm-svn: 147498
* Implement cross-module declaration merging for tag declarations, soDouglas Gregor2012-01-035-0/+59
| | | | | | | | | | | | that if two modules A and B both contain a declaration of a tag such as struct X; and those two modules are unrelated, the two declarations of X will be merged into a single redeclaration chain. llvm-svn: 147488
* Re-uglify #public and #private to #__public_macro and #__private_macro.Douglas Gregor2012-01-035-7/+7
| | | | llvm-svn: 147469
* Eliminate the uglified keyword __import_module__ for importingDouglas Gregor2012-01-0320-72/+83
| | | | | | | | | | | | | modules. This leaves us without an explicit syntax for importing modules in C/C++, because such a syntax needs to be discussed first. In Objective-C/Objective-C++, the @import syntax is used to import modules. Note that, under -fmodules, C/C++ programs can import modules via the #include mechanism when a module map is in place for that header. This allows us to work with modules in C/C++ without committing to a syntax. llvm-svn: 147467
* Under -fmodules, accept #public <macroname> and #private <macroname>Douglas Gregor2012-01-0313-30/+30
| | | | | | | to make a macro public (the default for headers) or private, respectively. llvm-svn: 147455
* Introduce a non-uglified syntax for module imports in Objective-C:Douglas Gregor2012-01-0320-32/+32
| | | | | | @import identifier [. identifier]* ; llvm-svn: 147452
* Don't attempt to merge a deserialized declaration with existingDouglas Gregor2012-01-031-2/+2
| | | | | | | declarations in the AST unless modules are enabled. This case doesn't come up with precompiled headers, and it isn't cheap. llvm-svn: 147451
* Rename the command-line option for mapping #include/#import over toDouglas Gregor2012-01-039-10/+10
| | | | | | | | module imports from -fauto-module-import to -fmodules. The new name will eventually be used to enable modules, and the #include/#import mapping is a crucial part of the feature. llvm-svn: 147447
* Diagnose cases where the definition of a particular type is required,Douglas Gregor2012-01-022-3/+23
| | | | | | | is known (to Clang), but is not visible because the module has not yet been imported. llvm-svn: 147436
* Implement declaration merging for Objective-C protocols acrossDouglas Gregor2012-01-014-0/+20
| | | | | | | multiple, disjoint modules. There is far too much duplicating with the ObjCInterfaceDecl case here, which I'll eliminate shortly. llvm-svn: 147417
* Wire up redeclaration chains for Objective-C protocols, so that bothDouglas Gregor2012-01-015-0/+29
| | | | | | | forward declarations and definitions of an Objective-C protocol are represented within a single chain of ObjCProtocolDecls. llvm-svn: 147412
* Implement support for module requirements, which indicate the languageDouglas Gregor2011-12-314-0/+21
| | | | | | | | | features needed for a particular module to be available. This allows mixed-language modules, where certain headers only work under some language variants (e.g., in C++, std.tuple might only be available in C++11 mode). llvm-svn: 147387
* When building a module with an umbrella header, warn about any headersDouglas Gregor2011-12-232-3/+7
| | | | | | | | found within that umbrella directory that were not actually included by the umbrella header. They should either be referenced in the module map or included by the umbrella header. llvm-svn: 147207
* Serialize the AST reader's mapping from canonical declarations to theDouglas Gregor2011-12-223-1/+10
| | | | | | | | | | | | | | | | set of (previously-canonical) declaration IDs to the module file, so that future AST reader instances that load the module know which declarations are merged. This is important in the fairly tricky case where a declaration of an entity, e.g., @class X; occurs before the import of a module that also declares that entity. We merge the declarations, and record the fact that the declaration of X loaded from the module was merged into the (now canonical) declaration of X that we parsed. llvm-svn: 147181
* If we end up merging an Objective-C class with an existing Objective-CDouglas Gregor2011-12-225-0/+26
| | | | | | | class that comes from a different module file, make sure that we load all of the pending declarations for the original declaration. llvm-svn: 147168
OpenPOWER on IntegriCloud