diff options
| author | Douglas Gregor <dgregor@apple.com> | 2013-05-10 22:52:27 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2013-05-10 22:52:27 +0000 |
| commit | 30a16f1383b56cb71be251999a577b2e37db2ce0 (patch) | |
| tree | 9e7763fc43203050597067bd4e694ea04aef4a53 /lib/Lex/HeaderSearch.cpp | |
| parent | c1478618363083486679fc8325b88fc30bd5aac7 (diff) | |
| download | clang-30a16f1383b56cb71be251999a577b2e37db2ce0.tar.gz clang-30a16f1383b56cb71be251999a577b2e37db2ce0.tar.bz2 clang-30a16f1383b56cb71be251999a577b2e37db2ce0.tar.xz | |
[Modules] Make r180934 more efficient by only loading top-level module maps in system header directories.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181643 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/HeaderSearch.cpp')
| -rw-r--r-- | lib/Lex/HeaderSearch.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp index b8556dde0b..8a99ed2988 100644 --- a/lib/Lex/HeaderSearch.cpp +++ b/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; |
