summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-05-10 22:52:27 +0000
committerDouglas Gregor <dgregor@apple.com>2013-05-10 22:52:27 +0000
commit64a1fa5cdaab414c06ef8ca7bd851ade5a34dae6 (patch)
treeab67cde467c81b31f9cd69df6e9178d1ab92f67c /clang/lib/Lex/HeaderSearch.cpp
parent783c79446b96d712da9f0bcaaba82481a36b7712 (diff)
downloadbcm5719-llvm-64a1fa5cdaab414c06ef8ca7bd851ade5a34dae6.tar.gz
bcm5719-llvm-64a1fa5cdaab414c06ef8ca7bd851ade5a34dae6.zip
[Modules] Make r180934 more efficient by only loading top-level module maps in system header directories.
llvm-svn: 181643
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r--clang/lib/Lex/HeaderSearch.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index b8556dde0b2..8a99ed29883 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -1146,6 +1146,20 @@ void HeaderSearch::collectAllModules(SmallVectorImpl<Module *> &Modules) {
}
}
+void HeaderSearch::loadTopLevelSystemModules() {
+ // Load module maps for each of the header search directories.
+ for (unsigned Idx = 0, N = SearchDirs.size(); Idx != N; ++Idx) {
+ // We only care about normal system header directories.
+ if (!SearchDirs[Idx].isNormalDir() ||
+ SearchDirs[Idx].getDirCharacteristic() != SrcMgr::C_System) {
+ continue;
+ }
+
+ // Try to load a module map file for the search directory.
+ loadModuleMapFile(SearchDirs[Idx].getDir());
+ }
+}
+
void HeaderSearch::loadSubdirectoryModuleMaps(DirectoryLookup &SearchDir) {
if (SearchDir.haveSearchedAllModuleMaps())
return;
OpenPOWER on IntegriCloud