summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/HeaderSearch.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Teach subframework header lookup to suggest modules <rdar://problem/13176200>.Douglas Gregor2013-02-081-1/+22
| | | | llvm-svn: 174683
* <limits.h> includes <linux/limits.h> on Linux, no need to special-case itDmitri Gribenko2013-01-261-3/+1
| | | | llvm-svn: 173578
* Since we're stuck with realpath for the header <-> module mapping,Douglas Gregor2013-01-261-6/+5
| | | | | | | | factor the realpath calls into FileManager::getCanonicalName() so we can cache the results of this epically slow operation. 5% speedup on my modules test, and realpath drops out of the profile. llvm-svn: 173542
* Fix compilation on Linux, which defines PATH_MAX in a weird place,Douglas Gregor2013-01-221-0/+5
| | | | | | from Saleem Abdulrasool! llvm-svn: 173208
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-4/+4
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Rework the realpath nonsense for framework lookups to deal moreDouglas Gregor2013-01-101-97/+117
| | | | | | uniformly with symlinks between top-level and embedded frameworks. llvm-svn: 172030
* Return true from HeaderSearch::isFileMultipleIncludeGuarded if the fileArgyrios Kyrtzidis2012-12-101-1/+2
| | | | | | was #import'ed. llvm-svn: 169761
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-5/+5
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Introduce inferred framework modules into the module map file,Douglas Gregor2012-11-061-1/+27
| | | | | | | | | | | | | | allowing a module map to be placed one level above the '.framework' directories to specify that all .frameworks within that directory can be inferred as framework modules. One can also specifically exclude frameworks known not to work. This makes explicit (and more restricted) behavior modules have had "forever", where *any* .framework was assumed to be able to be built as a module. That's not necessarily true, so we white-list directories (with exclusions) when those directories have been audited. llvm-svn: 167482
* Move HeaderSearchOptions into the Lex library, make it intrusivelyDouglas Gregor2012-10-241-2/+4
| | | | | | reference-counted, and hold a reference to it in HeaderSearch. llvm-svn: 166583
* Under certain terrible circumstances (<rdar://problem/10805775>),Douglas Gregor2012-09-251-0/+13
| | | | | | | | | top-level frameworks can actually be symlinked over to embedded frameworks, and accessed via the top-level framework's headers. In this case, we need to determine that the framework was *actually* an embedded framework, so we can load the appropriate top-level module. llvm-svn: 164620
* Remove an unused private field exposed by the recent LLVM_DELETED_FUNCTION ↵Craig Topper2012-09-181-1/+1
| | | | | | changes. llvm-svn: 164103
* When the header file search resolves a quoted include to a file in theDouglas Gregor2012-08-131-5/+13
| | | | | | | | | | | current directory, propagate the framework and in-index-header-map from the including header's information down to the included header's information. Fixes <rdar://problem/11261291>. As with everything header-map related, we can't really test this in isolation within Clang, so it's tested elsewhere. llvm-svn: 161759
* Fix a typo (the the => the)Sylvestre Ledru2012-07-231-1/+1
| | | | llvm-svn: 160622
* Documentation cleanup:James Dennett2012-06-201-8/+4
| | | | | | | | * Escaped # and < characters in Doxygen comments as needed; * Removed a Doxygen comment in HeaderSearch.cpp that was redundant with the corresponding comment in the header file. llvm-svn: 158776
* Rename a loop variable to silence a gcc warning.Richard Trieu2012-06-131-3/+3
| | | | llvm-svn: 158420
* Add -isystem-prefix and -ino-system-prefix arguments, which can be used toRichard Smith2012-06-131-0/+10
| | | | | | | | | | override whether headers are system headers by checking for prefixes of the header name specified in the #include directive. This allows warnings to be disabled for third-party code which is found in specific subdirectories of include paths. llvm-svn: 158418
* [Lex] Add support for 'user specified system frameworks' (see test case).Daniel Dunbar2012-04-051-7/+30
| | | | | | - Developers of system frameworks need a way for their framework to be treated as a "system framework" during development. Otherwise, they are unable to properly test how their framework behaves when installed because of the semantic changes (in warning behavior) applied to system frameworks. llvm-svn: 154105
* [Lex] HeaderSearch: Introduce a FrameworkCacheEntry structure to hold the ↵Daniel Dunbar2012-04-051-13/+11
| | | | | | | | FrameworkMap items. - No functionality change. llvm-svn: 154104
* Simplify.Daniel Dunbar2012-04-051-2/+1
| | | | llvm-svn: 154103
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-15/+15
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Thread a TargetInfo through to the module map; we'll need it forDouglas Gregor2012-01-301-2/+7
| | | | | | target-specific module requirements. llvm-svn: 149224
* Implement code completion support for module import declarations, e.g.,Douglas Gregor2012-01-291-0/+55
| | | | | | | | | | | | @import <complete with module names here> or @import std.<complete with submodule names here> Addresses <rdar://problem/10710117>. llvm-svn: 149199
* Rework HeaderSearch's interface for getting a module from a name andDouglas Gregor2012-01-291-96/+71
| | | | | | | | | for getting the name of the module file, unifying the code for searching for a module with a given name (into lookupModule()) and separating out the mapping to a module file (into getModuleFileName()). No functionality change. llvm-svn: 149197
* Introduce module attributes into the module map grammar, along with aDouglas Gregor2012-01-271-5/+11
| | | | | | | | | | | | | 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
* When inferring a module for a framework, first determine whether thatDouglas Gregor2012-01-131-3/+44
| | | | | | | | | | | | | 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
* Implement support for module requirements, which indicate the languageDouglas Gregor2011-12-311-4/+5
| | | | | | | | | 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 performing subframework header lookup, don't search forDouglas Gregor2011-12-091-3/+7
| | | | | | | ".framework/" in the path name, because it could be ".framework\" on Windows. This whole function needs to be rewritten with PathV2. llvm-svn: 146261
* Move a free function from the Frontend library into the Lex library asChandler Carruth2011-12-091-0/+23
| | | | | | | | part of HeaderSearch. This function just normalizes filenames for use inside of a synthetic include directive, but it is used in both the Frontend and Serialization libraries so it needs a common home. llvm-svn: 146227
* Keep track of import dependencies between submodules within the moduleDouglas Gregor2011-12-081-13/+5
| | | | | | | that's currently being built. This is important for supporting transitive dependencies ("export *" in the module map) completely. llvm-svn: 146156
* Make sure we pick up module_private.map when loading a module.map file.Douglas Gregor2011-12-071-1/+10
| | | | llvm-svn: 146074
* Implement basic support for private headers in frameworks. In essence,Douglas Gregor2011-12-071-5/+23
| | | | | | | | | 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
* When inferring a module map for a framework, infer subframeworkDouglas Gregor2011-12-061-1/+1
| | | | | | modules for each of its subframeworks. llvm-svn: 145957
* When suggesting a module import for a #include or #import, suggest theDouglas Gregor2011-12-061-6/+3
| | | | | | | | 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
* Promote ModuleMap::Module to a namespace-scope class in the BasicDouglas Gregor2011-11-301-13/+13
| | | | | | | | | 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
* When attempting to load a module that is not in the module cache,Douglas Gregor2011-11-281-48/+27
| | | | | | | | return the module itself (in the module map) rather than returning the umbrella header used to build the module. While doing this, make sure that we're inferring modules for frameworks to build that module. llvm-svn: 145310
* Allow preprocessor callbacks to recover from a "file not found" error,Douglas Gregor2011-11-201-2/+3
| | | | | | from Jason Haslam! llvm-svn: 145012
* When making a suggestion regarding which module to load rather thanDouglas Gregor2011-11-171-11/+11
| | | | | | | preprocess/parse a header, report back with an actual module (which may be a submodule) rather than just the name of the module. llvm-svn: 144925
* When we're loading a framework header, first try to turn the frameworkDouglas Gregor2011-11-171-6/+42
| | | | | | | | | 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 support for building a module from a module map to the -cc1Douglas Gregor2011-11-161-0/+40
| | | | | | | interface. This is currently limited to modules with umbrella headers. llvm-svn: 144736
* Implement a minor optimization when loading module maps to satisfy aDouglas Gregor2011-11-121-14/+22
| | | | | | | | module import: don't re-check for a loaded module unless we've actually loaded a new module map file. Already-loaded module map files aren't interesting. llvm-svn: 144435
* When searching for a module, speculatively load module maps to see ifDouglas Gregor2011-11-121-40/+75
| | | | | | | | 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
* Teach the search for modules to consider modules described by a moduleDouglas Gregor2011-11-111-1/+11
| | | | | | | | | | | | | | 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-3/+5
| | | | | | | 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
* Introduce basic support for parsing module map files.Douglas Gregor2011-11-111-1/+91
| | | | | | | | | | | | | | Module map files provide a way to map between headers and modules, so that we can layer a module system on top of existing headers without changing those headers at all. This commit introduces the module map file parser and the module map that it generates, and wires up the module map file parser so that we'll automatically find module map files as part of header search. Note that we don't yet use the information stored in the module map. llvm-svn: 144402
* I predict that HeaderSearch will need the ability to generateDouglas Gregor2011-11-111-2/+3
| | | | | | diagnostics in the future. Make it so. llvm-svn: 144347
* When we load header file information from the external source (i.e.,Douglas Gregor2011-09-171-8/+28
| | | | | | | | the AST reader), merge that header file information with whatever header file information we already have. Otherwise, we might forget something we already knew (e.g., that the header was #import'd already). llvm-svn: 139979
* Tweak the module auto-import heuristics a bitDouglas Gregor2011-09-161-1/+2
| | | | llvm-svn: 139887
* Add an experimental flag -fauto-module-import that automatically turnsDouglas Gregor2011-09-151-9/+33
| | | | | | | #include or #import direcctives of framework headers into module imports of the corresponding framework module. llvm-svn: 139860
OpenPOWER on IntegriCloud