summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ModuleManager.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove unused variable.Benjamin Kramer2013-03-211-3/+0
| | | | llvm-svn: 177657
* <rdar://problem/13363214> Eliminate race condition between module rebuild ↵Douglas Gregor2013-03-191-26/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | and the global module index. The global module index was querying the file manager for each of the module files it knows about at load time, to prune out any out-of-date information. The file manager would then cache the results of the stat() falls used to find that module file. Later, the same translation unit could end up trying to import one of the module files that had previously been ignored by the module cache, but after some other Clang instance rebuilt the module file to bring it up-to-date. The stale stat() results in the file manager would trigger a second rebuild of the already-up-to-date module, causing failures down the line. The global module index now lazily resolves its module file references to actual AST reader module files only after the module file has been loaded, eliminating the stat-caching race. Moreover, the AST reader can communicate to its caller that a module file is missing (rather than simply being out-of-date), allowing us to simplify the module-loading logic and allowing the compiler to recover if a dependent module file ends up getting deleted. llvm-svn: 177367
* Never cache the result of a module file lookup.Douglas Gregor2013-02-081-3/+6
| | | | llvm-svn: 174744
* Eliminate memory allocation from most invocations ofDouglas Gregor2013-01-281-13/+38
| | | | | | | | | | ModuleManager::visit() by keeping a free list of the two data structures used to store state (a preallocated stack and a visitation number vector). Improves -fsyntax-only performance for my modules test case by 2.8%. Modules has pulled ahead by almost 10% with the global module index. llvm-svn: 173692
* Improve coordination between the module manager and the global moduleDouglas Gregor2013-01-251-5/+51
| | | | | | | | | index, optimizing the operation that skips lookup in modules where we know the identifier will not be found. This makes the global module index optimization actually useful, providing an 8.5% speedup over modules without the global module index for -fsyntax-only. llvm-svn: 173529
* Optimize ModuleManager::visit() by precomputing the visitation orderDouglas Gregor2013-01-251-65/+82
| | | | | | | | | | and limiting ourselves to two memory allocations. 10% speedup in -fsyntax-only time for modules. With this change, we can actually see some performance different from the global module index, but it's still about 1%. llvm-svn: 173512
* Implement the reader of the global module index and wire it into theDouglas Gregor2013-01-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | AST reader. The global module index tracks all of the identifiers known to a set of module files. Lookup of those identifiers looks first in the global module index, which returns the set of module files in which that identifier can be found. The AST reader only needs to look into those module files and any module files not known to the global index (e.g., because they were (re)built after the global index), reducing the number of on-disk hash tables to visit. For an example source I'm looking at, we go from 237844 total identifier lookups into on-disk hash tables down to 126817. Unfortunately, this does not translate into a performance advantage. At best, it's a wash once the global module index has been built, but that's ignore the cost of building the global module index (which is itself fairly large). Profiles show that the global module index code is far less efficient than it should be; optimizing it might give enough of an advantage to justify its continued inclusion. llvm-svn: 173405
* Give ModuleFiles an index, so that we can use indexed vectors ratherDouglas Gregor2013-01-211-20/+30
| | | | | | | than DenseMaps and SmallPtrSets for module-visitation data. ~2.6% speedup for modules. llvm-svn: 173081
* Actually keep track of the source locations at which particular moduleDouglas Gregor2012-11-301-4/+8
| | | | | | files are loaded. llvm-svn: 169027
* When loading a module fails because it is out of date, rebuild thatDouglas Gregor2012-11-071-0/+39
| | | | | | module in place. <rdar://problem/10138913> llvm-svn: 167539
* Set the file entry for a Module* that was created during deserializationArgyrios Kyrtzidis2012-10-031-1/+2
| | | | | | of a module file. llvm-svn: 165086
* Optimize unqualified/global name lookup in modules by introducing aDouglas Gregor2012-01-181-2/+3
| | | | | | | | | | generational scheme for identifiers that avoids searching the hash tables of a given module more than once for a given identifier. Previously, loading any new module invalidated all of the previous lookup results for all identifiers, causing us to perform the lookups repeatedly. llvm-svn: 148412
* Promote ModuleMap::Module to a namespace-scope class in the BasicDouglas Gregor2011-11-301-25/+25
| | | | | | | | | 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
* Add support for viewing the module graph via Graphviz, for debuggingDouglas Gregor2011-10-111-0/+49
| | | | | | purposes. llvm-svn: 141697
* Factor the Module and ModuleManager classes out into separate headersDouglas Gregor2011-08-251-0/+204
and .cpp files, since ASTReader.cpp was getting way too large. No functionality change. llvm-svn: 138582
OpenPOWER on IntegriCloud