summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/HeaderSearch.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* For modules, use a hash of the compiler version, language options, andDouglas Gregor2011-09-131-3/+12
| | | | | | | | | target triple to separate modules built under different conditions. The hash is used to create a subdirectory in the module cache path where other invocations of the compiler (with the same version, language options, etc.) can find the precompiled modules. llvm-svn: 139662
* When an import statement fails to find a module in the module cache,Douglas Gregor2011-09-121-3/+37
| | | | | | | | | but there is a corresponding umbrella header in a framework, build the module on-the-fly so it can be immediately loaded at the import statement. This is very much proof-of-concept code, with details to be fleshed out over time. llvm-svn: 139558
* Introduce a cc1-level option to provide the path to the module cache,Douglas Gregor2011-09-121-0/+10
| | | | | | | | where the compiler will look for module files. Eliminates the egregious hack where we looked into the header search paths for modules. llvm-svn: 139538
* Use the "Bar.h" -> <Foo/Bar.h> remapping for index header maps only asDouglas Gregor2011-07-301-16/+23
| | | | | | | a fallback, if normal header search fails. Another attempt at <rdar://problem/9824020>. llvm-svn: 136557
* Introduce the "-index-header-map" option, to give special semanticsDouglas Gregor2011-07-281-3/+35
| | | | | | | for quoted header lookup when dealing with not-yet-installed frameworks. Fixes <rdar://problem/9824020>. llvm-svn: 136331
* Change HeaderSearch::getTotalMemory() to use llvm::capacity_in_bytes().Ted Kremenek2011-07-271-2/+3
| | | | llvm-svn: 136237
* clang_getCXTUResourceUsage: report memory used by HeaderSearch.Ted Kremenek2011-07-261-1/+7
| | | | | | | This required converting the StringMaps to use a BumpPtrAllocator. I measured the compile time and saw no observable regression. llvm-svn: 136190
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-17/+17
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Fix up dependency file name printing to more closely match that of gcc, ↵Eli Friedman2011-07-081-4/+2
| | | | | | | | including fixing a nasty recent regression that could make us print "/foo.h" with a command-line including "-I ./". rdar://problem/9734352 llvm-svn: 134728
* Make it possible for external tools to distinguish between paths that come ↵Nico Weber2011-05-241-1/+2
| | | | | | from -I and paths that come from -system. Patch from Paul Holden! llvm-svn: 131955
* Introduce a new libclang API, clang_isFileMultipleIncludeGuarded(),Douglas Gregor2011-05-041-0/+15
| | | | | | | | which determines whether a particular file is actually a header that is intended to be guarded from multiple inclusions within the same translation unit. llvm-svn: 130808
* Use DirectoryLookup::getName() rather than getDir()->getName() in a context ↵Douglas Gregor2011-04-291-1/+1
| | | | | | where we don't know whether we have a normal directory llvm-svn: 130467
* To be able to replay compilations we need to accurately remodel howManuel Klimek2011-04-261-19/+83
| | | | | | | | | includes get resolved, especially when they are found relatively to another include file. We also try to get it working for framework includes, but that part of the code is untested, as I don't have a code base that uses it. llvm-svn: 130246
* Having FileManager::getFile always open the file, brought much consternation ↵Argyrios Kyrtzidis2011-03-161-7/+8
| | | | | | | | | | | and leaking of file descriptors. Add 'openFile' bool to FileManager::getFile to specify whether we want to have the file opened or not, have it false by default, and enable it only in HeaderSearch.cpp where the open+fstat optimization matters. Fixes rdar://9139899. llvm-svn: 127748
* Add a 'RawPath' parameter to the PPCallbacks interface. This allowsChandler Carruth2011-03-161-14/+32
| | | | | | | | | | | | | | | clients to observe the exact path through which an #included file was located. This is very useful when trying to record and replay inclusion operations without it beind influenced by the aggressive caching done inside the FileManager to avoid redundant system calls and filesystem operations. The work to compute and return this is only done in the presence of callbacks, so it should have no effect on normal compilation. Patch by Manuel Klimek. llvm-svn: 127742
* Implement two related optimizations that make de-serialization ofDouglas Gregor2011-02-101-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AST/PCH files more lazy: - Don't preload all of the file source-location entries when reading the AST file. Instead, load them lazily, when needed. - Only look up header-search information (whether a header was already #import'd, how many times it's been included, etc.) when it's needed by the preprocessor, rather than pre-populating it. Previously, we would pre-load all of the file source-location entries, which also populated the header-search information structure. This was a relatively minor performance issue, since we would end up stat()'ing all of the headers stored within a AST/PCH file when the AST/PCH file was loaded. In the normal PCH use case, the stat()s were cached, so the cost--of preloading ~860 source-location entries in the Cocoa.h case---was relatively low. However, the recent optimization that replaced stat+open with open+fstat turned this into a major problem, since the preloading of source-location entries would now end up opening those files. Worse, those files wouldn't be closed until the file manager was destroyed, so just opening a Cocoa.h PCH file would hold on to ~860 file descriptors, and it was easy to blow through the process's limit on the number of open file descriptors. By eliminating the preloading of these files, we neither open nor stat the headers stored in the PCH/AST file until they're actually needed for something. Concretely, we went from *** HeaderSearch Stats: 835 files tracked. 364 #import/#pragma once files. 823 included exactly once. 6 max times a file is included. 3 #include/#include_next/#import. 0 #includes skipped due to the multi-include optimization. 1 framework lookups. 0 subframework lookups. *** Source Manager Stats: 835 files mapped, 3 mem buffers mapped. 37460 SLocEntry's allocated, 11215575B of Sloc address space used. 62 bytes of files mapped, 0 files with line #'s computed. with a trivial program that uses a chained PCH including a Cocoa PCH to *** HeaderSearch Stats: 4 files tracked. 1 #import/#pragma once files. 3 included exactly once. 2 max times a file is included. 3 #include/#include_next/#import. 0 #includes skipped due to the multi-include optimization. 1 framework lookups. 0 subframework lookups. *** Source Manager Stats: 3 files mapped, 3 mem buffers mapped. 37460 SLocEntry's allocated, 11215575B of Sloc address space used. 62 bytes of files mapped, 0 files with line #'s computed. for the same program. llvm-svn: 125286
* Replace all uses of PathV1::exists with PathV2::fs::exists.Michael J. Spencer2011-01-101-2/+3
| | | | llvm-svn: 123150
* Replace all uses of PathV1::isAbsolute with PathV2::is_{absolute,relative}.Michael J. Spencer2010-12-171-1/+1
| | | | llvm-svn: 122087
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120297
* now the FileManager has a FileSystemOpts ivar, stop threadingChris Lattner2010-11-231-17/+12
| | | | | | | | | FileSystemOpts through a ton of apis, simplifying a lot of code. This also fixes a latent bug in ASTUnit where it would invoke methods on FileManager without creating one in some code paths in cindextext. llvm-svn: 120010
* remove old compatibility APIs, use StringRef versions instead.Chris Lattner2010-11-211-13/+7
| | | | llvm-svn: 119935
* Implement -working-directory.Argyrios Kyrtzidis2010-11-031-11/+19
| | | | | | | | | | | | | | | | | | | When -working-directory is passed in command line, file paths are resolved relative to the specified directory. This helps both when using libclang (where we can't require the user to actually change the working directory) and to help reproduce test cases when the reproduction work comes along. --FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains the working directory value if set). --FileSystemOptions are passed around to various interfaces that perform file operations. --Opening & reading the content of files should be done only through FileManager. This is useful in general since file operations will be abstracted in the future for the reproduction mechanism. FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same FileManager but with different FileSystemOptions. Addresses rdar://8583824. llvm-svn: 118203
* Revert r110440, the fix for PR4897. Chris claims to have a better way.Douglas Gregor2010-08-081-24/+20
| | | | llvm-svn: 110544
* Fix the #include search path when reading from stdin, from Jon Simons!Douglas Gregor2010-08-061-20/+24
| | | | | | Fixes PR4897. llvm-svn: 110440
* stringref'ize a bunch of filename handling logic. MuchChris Lattner2010-01-101-28/+24
| | | | | | nicer than passing around two const char*'s. llvm-svn: 93094
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-56/+56
| | | | llvm-svn: 81346
* use the new Path::isAbsolute function, fixing a fixme. Patch by Gregory ↵Chris Lattner2009-06-151-3/+1
| | | | | | Curfman! llvm-svn: 73370
* Lazily load the controlling macros for all of the headers known in theDouglas Gregor2009-04-251-6/+20
| | | | | | | | PCH file. In the Cocoa-prefixed "Hello, World" benchmark, this takes us from reading 503 identifiers down to 37 and from 470 macros down to 4. It also results in an 8% performance improvement. llvm-svn: 70094
* Add PCH support for #import.Steve Naroff2009-04-241-3/+9
| | | | llvm-svn: 69987
* improve compatibility with GCC 4.4, patch by Michel Salim (PR3697)Chris Lattner2009-03-021-0/+1
| | | | llvm-svn: 65884
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+425
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud