]> granicus.if.org Git - clang/commit
Implement the reader of the global module index and wire it into the
authorDouglas Gregor <dgregor@apple.com>
Fri, 25 Jan 2013 01:03:03 +0000 (01:03 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 25 Jan 2013 01:03:03 +0000 (01:03 +0000)
commit1a49d97d762570027863e9209af81d445e4f1502
tree5cdf83bac7676fb5c8ac653bb240bfac6be5d7e7
parentf575d6e7c3b887ea4c5394d2c7e322c7a929a57e
Implement the reader of the global module index and wire it into the
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173405 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Serialization/ASTReader.h
include/clang/Serialization/GlobalModuleIndex.h
lib/Frontend/CompilerInstance.cpp
lib/Serialization/ASTReader.cpp
lib/Serialization/GlobalModuleIndex.cpp
lib/Serialization/ModuleManager.cpp
test/Modules/global_index.m