Deduplicate search paths.

Now that we can pick up search paths from frameworks (necessary to debug
them properly), we can end up with exponential explosions leading to the
same search path coming up thousands of times, which destroys compilation
time /and/ debugger responsiveness. This is already hitting people with
frameworks compiled for app extensions (due to a mistaken approximation
of whether or not something is a framework), but we're turning this on for
all frameworks in the immediate future.

rdar://problem/20291720

Swift SVN r27087
This commit is contained in:
Jordan Rose
2015-04-07 18:24:12 +00:00
parent 2c143aee96
commit f0d529719c
7 changed files with 65 additions and 11 deletions

View File

@@ -1013,16 +1013,10 @@ Status ModuleFile::associateWithFileContext(FileUnit *file,
return error(Status::TargetTooNew);
}
auto clangImporter = static_cast<ClangImporter *>(ctx.getClangModuleLoader());
for (const auto &searchPathPair : SearchPaths)
ctx.addSearchPath(searchPathPair.first, searchPathPair.second);
for (const auto &searchPathPair : SearchPaths) {
if (searchPathPair.second) {
ctx.SearchPathOpts.FrameworkSearchPaths.push_back(searchPathPair.first);
} else {
ctx.SearchPathOpts.ImportSearchPaths.push_back(searchPathPair.first);
}
clangImporter->addSearchPath(searchPathPair.first, searchPathPair.second);
}
auto clangImporter = static_cast<ClangImporter *>(ctx.getClangModuleLoader());
bool missingDependency = false;
for (auto &dependency : Dependencies) {