summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* Make sure this test works in C++, tooDouglas Gregor2011-12-191-0/+1
| | | | llvm-svn: 146868
* Completely re-implement (de-)serialization of declarationDouglas Gregor2011-12-176-1/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | chains. The previous implementation relied heavily on the declaration chain being stored as a (circular) linked list on disk, as it is in memory. However, when deserializing from multiple modules, the different chains could get mixed up, leading to broken declaration chains. The new solution keeps track of the first and last declarations in the chain for each module file. When we load a declaration, we search all of the module files for redeclarations of that declaration, then splice together all of the lists into a coherent whole (along with any redeclarations that were actually parsed). As a drive-by fix, (de-)serialize the redeclaration chains of TypedefNameDecls, which had somehow gotten missed previously. Add a test of this serialization. This new scheme creates a redeclaration table that is fairly large in the PCH file (on the order of 400k for Cocoa.h's 12MB PCH file). The table is mmap'd in and searched via a binary search, but it's still quite large. A future tweak will eliminate entries for declarations that have no redeclarations anywhere, and should drastically reduce the size of this table. llvm-svn: 146841
* Fix chaining of ObjCInterfaceDecl redeclarationsDouglas Gregor2011-12-162-0/+2
| | | | llvm-svn: 146722
* When name lookup finds a module-private Objective-C class declaration,Douglas Gregor2011-12-151-3/+1
| | | | | | check whether any previous declarations of the class were visible. llvm-svn: 146680
* Modify how the -verify flag works. Currently, the verification string andRichard Trieu2011-12-152-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic message are compared. If either is a substring of the other, then no error is given. This gives rise to an unexpected case: // expect-error{{candidate function has different number of parameters}} will match the following error messages from Clang: candidate function has different number of parameters (expected 1 but has 2) candidate function has different number of parameters It will also match these other error messages: candidate function function has different number of parameters number of parameters This patch will change so that the verification string must be a substring of the diagnostic message before accepting. Also, all the failing tests from this change have been corrected. Some stats from this cleanup: 87 - removed extra spaces around verification strings 70 - wording updates to diagnostics 40 - extra leading or trailing characters (typos, unmatched parens or quotes) 35 - diagnostic level was included (error:, warning:, or note:) 18 - flag name put in the warning (-Wprotocol) llvm-svn: 146619
* When name lookup comes across a declaration that is in a module thatDouglas Gregor2011-12-144-0/+31
| | | | | | | is not visible, look for any previous declarations of that entity that might be visible. llvm-svn: 146563
* When we have an umbrella directory in a module map, recursively walkDouglas Gregor2011-12-122-0/+5
| | | | | | the subdirectories to find headers in submodules. llvm-svn: 146398
* Don't mark include guard macros as implicitly private. This isn'tDouglas Gregor2011-12-121-0/+1
| | | | | | | actually a terribly good heuristic, and the world is too horrible for it to work. llvm-svn: 146393
* Implement the notion of umbrella directories, which implicity coverDouglas Gregor2011-12-097-0/+22
| | | | | | | | | | | | | all of the headers below that particular directory. Use umbrella directories as a clean way to deal with (1) directories/frameworks that don't have an umbrella header, but don't want to enumerate all of their headers, and (2) PrivateHeaders, which we never want to enumerate and want to keep separate from the main umbrella header. This also eliminates a little more of the "magic" for private headers, and frameworks in general. llvm-svn: 146235
* Implement umbrella directories for modules, which are similar toDouglas Gregor2011-12-084-0/+27
| | | | | | | | | | | | | | | umbrella headers in the sense that all of the headers within that directory (and eventually its subdirectories) are considered to be part of the module with that umbrella directory. However, unlike umbrella headers, which are expected to include all of the headers within their subdirectories, Clang will automatically include all of the headers it finds in the named subdirectory. The intent here is to allow a module map to trivially turn a subdirectory into a module, where the module's structure can mimic the directory structure. llvm-svn: 146165
* Tweak the syntax of umbrella headers, so that "umbrella" is treated asDouglas Gregor2011-12-083-5/+5
| | | | | | | | | | | a modifier for a header declarartion, e.g., umbrella header "headername" Collapse the umbrella-handling code in the parser into the header-handling code, so we don't duplicate the header-search logic. llvm-svn: 146159
* Keep track of import dependencies between submodules within the moduleDouglas Gregor2011-12-083-0/+13
| | | | | | | that's currently being built. This is important for supporting transitive dependencies ("export *" in the module map) completely. llvm-svn: 146156
* Implement inference for the "Private" submodule corresponding toDouglas Gregor2011-12-072-0/+5
| | | | | | private headers in a framework. llvm-svn: 146082
* Make sure we pick up module_private.map when loading a module.map file.Douglas Gregor2011-12-071-0/+2
| | | | llvm-svn: 146074
* Implement basic support for private headers in frameworks. In essence,Douglas Gregor2011-12-073-0/+11
| | | | | | | | | when we load a module map (module.map) from a directory, also load a private module map (module_private.map) for that directory, if present. That private module map can inject a new submodule that captures private headers. llvm-svn: 146012
* Rename Objective-C-only tests to .mDouglas Gregor2011-12-062-1/+1
| | | | llvm-svn: 145959
* When inferring a module map for a framework, infer subframeworkDouglas Gregor2011-12-063-2/+16
| | | | | | modules for each of its subframeworks. llvm-svn: 145957
* Allow inferred submodules for any (sub)module that has an umbrella headerDouglas Gregor2011-12-062-1/+5
| | | | llvm-svn: 145945
* When suggesting a module import for a #include or #import, suggest theDouglas Gregor2011-12-061-0/+11
| | | | | | | | most specific (sub)module based on the actual file we find, rather than always importing the top-level module. This means that #include'ing <Foo/Blah.h> should give us the submodule Foo.Blah. llvm-svn: 145942
* Implement modules support for subframeworks (aka embeddedDouglas Gregor2011-12-064-0/+22
| | | | | | | | frameworks). A submodule can now be labeled as a "framework", and header search will look into the appropriate Headers/PrivateHeaders subdirectories for named headers. llvm-svn: 145941
* When building the main file to parse given a module map, don't skipDouglas Gregor2011-12-061-0/+1
| | | | | | | | explicit submodules or umbrella headers from submodules. Instead, build the entire module at once, and let the name-hiding mechanisms hide the contents of explicit submodules at load time. llvm-svn: 145940
* Implement inferred submodules support, which (when requested)Douglas Gregor2011-12-064-0/+21
| | | | | | | implicitly generates submodules corresponding to the headers that fall within a module. llvm-svn: 145887
* Parse inferred submodules in module maps, track their contents inDouglas Gregor2011-12-051-0/+3
| | | | | | | Module, and (de-)serialize this information. Semantics of inferred submodules to follow. llvm-svn: 145864
* Inferred framework modules automatically export anything they importDouglas Gregor2011-12-052-0/+7
| | | | | | (i.e., 'export *'), to better match the semantics of headers. llvm-svn: 145813
* Implement support for wildcard exports in modules, allowing a moduleDouglas Gregor2011-12-059-2/+58
| | | | | | | | to re-export anything that it imports. This opt-in feature makes a module behave more like a header, because it can be used to re-export the transitive closure of a (sub)module's dependencies. llvm-svn: 145811
* Implement support for precompiled headers, preambles, and serializedDouglas Gregor2011-12-031-5/+0
| | | | | | | | "main" files that import modules. When loading any of these kinds of AST files, we make the modules that were imported visible into the translation unit that loaded the PCH file or preamble. llvm-svn: 145737
* Add missing test headerDouglas Gregor2011-12-021-0/+1
| | | | llvm-svn: 145710
* Only perform checking of the predefines buffer when loading aDouglas Gregor2011-12-021-0/+32
| | | | | | | | | | | | | precompiled header. Previously, we were trying to gather predefines buffers from all kinds of AST files (which doesn't make sense) and were performing some validation when AST files were loaded as main files. With these tweaks, using PCH files that import modules no longer fails immediately (due to mismatched predefines buffers). However, module visibility is lost, so this feature does not yet work. llvm-svn: 145709
* Make sure that name lookup in C checks whether a name is hidden.Douglas Gregor2011-12-021-3/+13
| | | | llvm-svn: 145700
* When making a module visible, also make any of its exported modulesDouglas Gregor2011-12-021-6/+0
| | | | | | | visible, allowing one to create modules that import (and then re-export) other modules. llvm-svn: 145696
* Implement name hiding for macro definitions within modules, such thatDouglas Gregor2011-12-024-4/+58
| | | | | | | | only the macro definitions from visible (sub)modules will actually be visible. This provides the same behavior for macros that r145640 provided for declarations. llvm-svn: 145683
* Implementing parsing and resolution of module export declarationsDouglas Gregor2011-12-021-3/+13
| | | | | | | | within module maps, which will (eventually) be used to re-export a module from another module. There are still some pieces missing, however. llvm-svn: 145665
* Implement name hiding for declarations deserialized from a non-visibleDouglas Gregor2011-12-017-2/+46
| | | | | | module. When that module becomes visible, so do those declarations. llvm-svn: 145640
* Introduce an opt-in warning indicating when the compiler is treatingDouglas Gregor2011-11-302-3/+3
| | | | | | an #include/#import as a module import. llvm-svn: 145500
* Add preprocessor-only test for submodule importsDouglas Gregor2011-11-301-0/+1
| | | | llvm-svn: 145490
* When loading a module that involves submodules (e.g., std.vector),Douglas Gregor2011-11-304-0/+20
| | | | | | | | | check whether the named submodules themselves are actually valid, and drill down to the named submodule (although we don't do anything with it yet). Perform typo correction on the submodule names when possible. llvm-svn: 145477
* Eliminate the -emit-module option, which emitted a module by parsing aDouglas Gregor2011-11-299-19/+19
| | | | | | | source file (e.g., a header). Immediately steal this useful option name for building modules from a module map file. llvm-svn: 145444
* Teach the module import mechanism how to rebuild modules expressed viaDouglas Gregor2011-11-291-4/+0
| | | | | | | module map, rather than assuming that there is an umbrella header. This allows us to automatically build umbrella-less modules. llvm-svn: 145415
* Add the notion of "framework" modules to module maps. FrameworkDouglas Gregor2011-11-172-0/+5
| | | | | | | modules (obviously) describe frameworks, and understand the header layout of frameworks. llvm-svn: 144921
* When we're loading a framework header, first try to turn the frameworkDouglas Gregor2011-11-171-1/+1
| | | | | | | | | into a module. This module can either be loaded from a module map in the framework directory (which isn't quite working yet) or inferred from an umbrella header (which does work, and replaces the existing hack). llvm-svn: 144877
* Add missing header for modules test.Douglas Gregor2011-11-161-0/+2
| | | | llvm-svn: 144862
* A module with an umbrella header assumes that all of the headers inDouglas Gregor2011-11-163-21/+24
| | | | | | | | the umbrella header's directory and its subdirectories are part of the module (that's why it's an umbrella). Make sure that these headers are considered to be part of the module for lookup purposes. llvm-svn: 144859
* Implement (de-)serialization of the buffer contents for an overriddenDouglas Gregor2011-11-161-3/+5
| | | | | | | | | | file in the source manager. This allows us to properly create and use modules described by module map files without umbrella headers (or with incompletely umbrella headers). More generally, we can actually build a PCH file that makes use of file -> buffer remappings, which could be useful in libclang in the future. llvm-svn: 144830
* When building a module from a module map that isn't simply an umbrellaDouglas Gregor2011-11-161-1/+0
| | | | | | | | header, create our own in-memory buffer to parse all of the appropriate headers, and use that to build the module. This isn't end-to-end testable yet; that's coming next. llvm-svn: 144797
* Switch the remaining modules tests over to -emit-module-from-map.Douglas Gregor2011-11-1610-91/+74
| | | | llvm-svn: 144795
* Migrate a few more modules tests over to -emit-module-from-map.Douglas Gregor2011-11-166-68/+62
| | | | llvm-svn: 144779
* Switch some more of the modules tests over to "-emit-module-from-map",Douglas Gregor2011-11-165-15/+20
| | | | | | and remove stray fprintf. llvm-svn: 144742
* Add support for building a module from a module map to the -cc1Douglas Gregor2011-11-163-7/+12
| | | | | | | interface. This is currently limited to modules with umbrella headers. llvm-svn: 144736
* Tweak the module map file test slightly, by putting one of the headersDouglas Gregor2011-11-121-1/+1
| | | | | | | | into a submodule. Submodules aren't actually supported anywhere else, but we do parse them, so this verifies that we're at least seeing through them properly. llvm-svn: 144436
* When searching for a module, speculatively load module maps to see ifDouglas Gregor2011-11-123-0/+6
| | | | | | | | the module is described in one of the module maps in a search path or in a subdirectory off the search path that has the same name as the module we're looking for. llvm-svn: 144433
OpenPOWER on IntegriCloud