Merge pull request #40155 from ahoppen/pr/improve-module-search-path-lookup

[Serialization] Improve module loading performance
This commit is contained in:
Alex Hoppen
2021-12-20 18:09:17 +01:00
committed by GitHub
24 changed files with 581 additions and 212 deletions

View File

@@ -510,9 +510,9 @@ bool SwiftInterfaceGenContext::matches(StringRef ModuleName,
const SearchPathOptions &SPOpts = Invok.getSearchPathOptions();
const SearchPathOptions &ImplSPOpts = Impl.Invocation.getSearchPathOptions();
if (SPOpts.ImportSearchPaths != ImplSPOpts.ImportSearchPaths)
if (SPOpts.getImportSearchPaths() != ImplSPOpts.getImportSearchPaths())
return false;
if (SPOpts.FrameworkSearchPaths != ImplSPOpts.FrameworkSearchPaths)
if (SPOpts.getFrameworkSearchPaths() != ImplSPOpts.getFrameworkSearchPaths())
return false;
if (Invok.getClangImporterOptions().ExtraArgs !=
@@ -857,14 +857,14 @@ void SwiftLangSupport::findInterfaceDocument(StringRef ModuleName,
addArgPair("-target", Invocation.getTargetTriple());
const auto &SPOpts = Invocation.getSearchPathOptions();
addArgPair("-sdk", SPOpts.SDKPath);
for (auto &FramePath : SPOpts.FrameworkSearchPaths) {
addArgPair("-sdk", SPOpts.getSDKPath());
for (const auto &FramePath : SPOpts.getFrameworkSearchPaths()) {
if (FramePath.IsSystem)
addArgPair("-Fsystem", FramePath.Path);
else
addArgPair("-F", FramePath.Path);
}
for (auto &Path : SPOpts.ImportSearchPaths)
for (const auto &Path : SPOpts.getImportSearchPaths())
addArgPair("-I", Path);
const auto &ClangOpts = Invocation.getClangImporterOptions();