summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/ModuleMap.cpp
Commit message (Collapse)AuthorAgeFilesLines
* User-defined literals: reject string and character UDLs in all places where theRichard Smith2012-03-061-0/+6
| | | | | | | | | | grammar requires a string-literal and not a user-defined-string-literal. The two constructs are still represented by the same TokenKind, in order to prevent a combinatorial explosion of different kinds of token. A flag on Token tracks whether a ud-suffix is present, in order to prevent clients from needing to look at the token's spelling. llvm-svn: 152098
* Basic: import IntrusiveRefCntPtr<> into clang namespaceDylan Noblesmith2012-02-201-2/+2
| | | | | | | The class name is long enough without the llvm:: added. Also bring in RefCountedBase and RefCountedBaseVPTR. llvm-svn: 150958
* Move instantiateTemplateAttribute into the sema namespace, make helpers static.Benjamin Kramer2012-02-061-1/+2
| | | | llvm-svn: 149864
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-6/+6
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Back out my heinous hack that tricked the module generation mechanismDouglas Gregor2012-02-021-5/+52
| | | | | | | | | | | | | | | | | | | | 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
* Thread a TargetInfo through to the module map; we'll need it forDouglas Gregor2012-01-301-3/+10
| | | | | | target-specific module requirements. llvm-svn: 149224
* Introduce module attributes into the module map grammar, along with aDouglas Gregor2012-01-271-7/+101
| | | | | | | | | | | | | 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
* Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie2012-01-171-2/+0
| | | | | | appropriate or when GCC requires it) llvm-svn: 148292
* Don't infer a submodule for a framework's private header, at least for now.Douglas Gregor2012-01-131-14/+1
| | | | llvm-svn: 148117
* Revert previous commit. Something has gone wonky with my local configurationDouglas Gregor2012-01-131-1/+0
| | | | llvm-svn: 148084
* When inferring a module map for a framework, add the 'private'Douglas Gregor2012-01-131-0/+1
| | | | | | | requirement to headers under PrivateHeaders. We don't want to build them as part of the module (yet). llvm-svn: 148082
* When inferring a submodule ID during module creation, look up theDouglas Gregor2012-01-061-5/+16
| | | | | | | | | | 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
* If we already have a definition for a top-level module that we deserialized ↵Douglas Gregor2012-01-051-0/+13
| | | | | | from a module file, don't bother parsing a new definition llvm-svn: 147574
* Store the submodules of a module in source order, as they are storedDouglas Gregor2012-01-041-25/+11
| | | | | | | | in the module map. This provides a bit more predictability for the user, as well as eliminating the need to sort the submodules when serializing them. llvm-svn: 147564
* Implement support for module requirements, which indicate the languageDouglas Gregor2011-12-311-6/+134
| | | | | | | | | 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
* Set umbrella directory correctly when we infer a framework moduleDouglas Gregor2011-12-121-1/+1
| | | | llvm-svn: 146451
* Implement the notion of umbrella directories, which implicity coverDouglas Gregor2011-12-091-67/+33
| | | | | | | | | | | | | 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-081-10/+73
| | | | | | | | | | | | | | | 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-081-101/+36
| | | | | | | | | | | 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
* Within the module representation, generalize the notion of an umbrellaDouglas Gregor2011-12-081-7/+7
| | | | | | | | | | header to also support umbrella directories. The umbrella directory for an umbrella header is the directory in which the umbrella header resides. No functionality change yet, but it's coming. llvm-svn: 146158
* Convert paths to native format before constructing aDouglas Gregor2011-12-081-5/+12
| | | | | | directory_iterator for them. llvm-svn: 146154
* Implement inference for the "Private" submodule corresponding toDouglas Gregor2011-12-071-5/+51
| | | | | | private headers in a framework. llvm-svn: 146082
* Implement basic support for private headers in frameworks. In essence,Douglas Gregor2011-12-071-20/+108
| | | | | | | | | 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
* Remove misleading error messageDouglas Gregor2011-12-061-2/+1
| | | | llvm-svn: 145958
* When inferring a module map for a framework, infer subframeworkDouglas Gregor2011-12-061-9/+33
| | | | | | modules for each of its subframeworks. llvm-svn: 145957
* Allow inferred submodules for any (sub)module that has an umbrella headerDouglas Gregor2011-12-061-9/+8
| | | | llvm-svn: 145945
* Implement modules support for subframeworks (aka embeddedDouglas Gregor2011-12-061-19/+39
| | | | | | | | 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
* Minor tweak to prepare for submodules with umbrella headers. No actualDouglas Gregor2011-12-061-7/+13
| | | | | | functionality change yet. llvm-svn: 145938
* Implement inferred submodules support, which (when requested)Douglas Gregor2011-12-061-30/+92
| | | | | | | 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-1/+103
| | | | | | | 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-051-0/+5
| | | | | | (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-051-1/+8
| | | | | | | | 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
* When writing a module file, keep track of the set of (sub)modules thatDouglas Gregor2011-12-051-0/+20
| | | | | | | it imports, establishing dependencies at the (sub)module granularity. This is not a user-visible change (yet). llvm-svn: 145808
* Implementing parsing and resolution of module export declarationsDouglas Gregor2011-12-021-1/+137
| | | | | | | | 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
* Unbreak build with GCC. Clang is too lame to diagnose this particular ↵Douglas Gregor2011-11-301-2/+0
| | | | | | ill-formedness llvm-svn: 145539
* Promote ModuleMap::Module to a namespace-scope class in the BasicDouglas Gregor2011-11-301-87/+7
| | | | | | | | | library, since modules cut across all of the libraries. Rename serialization::Module to serialization::ModuleFile to side-step the annoying naming conflict. Prune a bunch of ModuleMap.h includes that are no longer needed (most files only needed the Module type). llvm-svn: 145538
* Implement (de-)serialization of the description of a module and itsDouglas Gregor2011-11-301-0/+17
| | | | | | | | | submodules. This information will eventually be used for name hiding when dealing with submodules. For now, we only use it to ensure that the module "key" returned when loading a module will always be a module (rather than occasionally being a FileEntry). llvm-svn: 145497
* Use raw_ostream::indent.Benjamin Kramer2011-11-301-8/+4
| | | | llvm-svn: 145492
* Switch the module map printer over toDouglas Gregor2011-11-301-27/+2
| | | | | | raw_ostream::write_escaped. Thanks, Benjamin! llvm-svn: 145491
* Escape strings when printing module maps, for silly operating systemsDouglas Gregor2011-11-291-2/+31
| | | | | | that use \ as a separator. llvm-svn: 145439
* Switch on-demand module building over to use module maps, always. WhenDouglas Gregor2011-11-291-22/+32
| | | | | | | we infer the module map, we'll just print the module map to a temporary file and generate the module using that. llvm-svn: 145436
* Teach the module import mechanism how to rebuild modules expressed viaDouglas Gregor2011-11-291-0/+9
| | | | | | | module map, rather than assuming that there is an umbrella header. This allows us to automatically build umbrella-less modules. llvm-svn: 145415
* Expose the printing of module maps as part of the ModuleMap::ModuleDouglas Gregor2011-11-291-34/+36
| | | | | | interface. No functionality change. llvm-svn: 145411
* Add the notion of "framework" modules to module maps. FrameworkDouglas Gregor2011-11-171-9/+49
| | | | | | | modules (obviously) describe frameworks, and understand the header layout of frameworks. llvm-svn: 144921
* Actually free memory for the module mapsDouglas Gregor2011-11-171-0/+15
| | | | llvm-svn: 144880
* When we're loading a framework header, first try to turn the frameworkDouglas Gregor2011-11-171-0/+28
| | | | | | | | | 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
* A module with an umbrella header assumes that all of the headers inDouglas Gregor2011-11-161-0/+40
| | | | | | | | 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
* Silence unused variable warning.Benjamin Kramer2011-11-131-2/+2
| | | | llvm-svn: 144500
* Teach the search for modules to consider modules described by a moduleDouglas Gregor2011-11-111-0/+8
| | | | | | | | | | | | | | map, so long as they have an umbrella header. This makes it possible to introduce a module map + umbrella header for a given set of headers, to turn it into a module. There are two major deficiencies here: first, we don't go hunting for module map files when we just see a module import (so we won't know about the modules described therein). Second, we don't yet have a way to build modules that don't have umbrella headers, or have incomplete umbrella headers. llvm-svn: 144424
* Wire up the mapping from header files mentioned in module maps over toDouglas Gregor2011-11-111-0/+17
| | | | | | | the corresponding (top-level) modules. This isn't actually useful yet, because we don't yet have a way to build modules out of module maps. llvm-svn: 144410
OpenPOWER on IntegriCloud