Add SearchPathRemapper to SearchPathOptions

This is intended to be used from LLDB to apply the remappings
specified in target.source-map to remap any serialized
Swiftmodule search paths that were prefixed using
`-prefix-serialized-debugging-options`.
This commit is contained in:
Richard Howell
2021-09-21 11:11:50 -07:00
parent ce6b4b3ee0
commit 49f37abb95
2 changed files with 11 additions and 3 deletions

View File

@@ -158,9 +158,11 @@ Status ModuleFile::associateWithFileContext(FileUnit *file, SourceLoc diagLoc,
return error(status);
}
for (const auto &searchPath : Core->SearchPaths)
ctx.addSearchPath(searchPath.Path, searchPath.IsFramework,
searchPath.IsSystem);
for (const auto &searchPath : Core->SearchPaths) {
ctx.addSearchPath(
ctx.SearchPathOpts.SearchPathRemapper.remapPath(searchPath.Path),
searchPath.IsFramework, searchPath.IsSystem);
}
auto clangImporter = static_cast<ClangImporter *>(ctx.getClangModuleLoader());