mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user