aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Serialization/ModuleManager.cpp
AgeCommit message (Collapse)AuthorFilesLines
2013-01-28Eliminate memory allocation from most invocations ofDouglas Gregor1-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
2013-01-25Improve coordination between the module manager and the global moduleDouglas Gregor1-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
2013-01-25Optimize ModuleManager::visit() by precomputing the visitation orderDouglas Gregor1-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
2013-01-25Implement the reader of the global module index and wire it into theDouglas Gregor1-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
2013-01-21Give ModuleFiles an index, so that we can use indexed vectors ratherDouglas Gregor1-20/+30
than DenseMaps and SmallPtrSets for module-visitation data. ~2.6% speedup for modules. llvm-svn: 173081
2012-11-30Actually keep track of the source locations at which particular moduleDouglas Gregor1-4/+8
files are loaded. llvm-svn: 169027
2012-11-07When loading a module fails because it is out of date, rebuild thatDouglas Gregor1-0/+39
module in place. <rdar://problem/10138913> llvm-svn: 167539
2012-10-03Set the file entry for a Module* that was created during deserializationArgyrios Kyrtzidis1-1/+2
of a module file. llvm-svn: 165086
2012-01-18Optimize unqualified/global name lookup in modules by introducing aDouglas Gregor1-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
2011-11-30Promote ModuleMap::Module to a namespace-scope class in the BasicDouglas Gregor1-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
2011-10-11Add support for viewing the module graph via Graphviz, for debuggingDouglas Gregor1-0/+49
purposes. llvm-svn: 141697
2011-08-25Factor the Module and ModuleManager classes out into separate headersDouglas Gregor1-0/+204
and .cpp files, since ASTReader.cpp was getting way too large. No functionality change. llvm-svn: 138582