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

@@ -74,7 +74,7 @@ bool ModuleInterfaceBuilder::collectDepsForSerialization(
llvm::vfs::FileSystem &fs = *sourceMgr.getFileSystem();
auto &Opts = SubInstance.getASTContext().SearchPathOpts;
SmallString<128> SDKPath(Opts.SDKPath);
SmallString<128> SDKPath(Opts.getSDKPath());
path::native(SDKPath);
SmallString<128> ResourcePath(Opts.RuntimeResourcePath);
path::native(ResourcePath);
@@ -280,7 +280,7 @@ bool ModuleInterfaceBuilder::buildSwiftModuleInternal(
SerializationOpts.UserModuleVersion = FEOpts.UserModuleVersion;
// Record any non-SDK module interface files for the debug info.
StringRef SDKPath = SubInstance.getASTContext().SearchPathOpts.SDKPath;
StringRef SDKPath = SubInstance.getASTContext().SearchPathOpts.getSDKPath();
if (!getRelativeDepPath(InPath, SDKPath))
SerializationOpts.ModuleInterface = InPath;