Support hermetic indexing information

Swiftc port of https://github.com/apple/llvm-project/pull/4207.

This introduces a new flag, `-file-prefix-map` which can be used
instead of the existing `-debug-prefix-map` and `-coverage-prefix-map`
flags, and also remaps paths in index information currently.
This commit is contained in:
David Goldman
2022-04-12 18:19:35 -04:00
parent 3a9c801284
commit c232ed2913
14 changed files with 255 additions and 37 deletions

View File

@@ -1745,7 +1745,8 @@ static void emitIndexDataForSourceFile(SourceFile *PrimarySourceFile,
opts.IndexStorePath, opts.IndexSystemModules,
opts.IndexIgnoreStdlib, isDebugCompilation,
Invocation.getTargetTriple(),
*Instance.getDependencyTracker());
*Instance.getDependencyTracker(),
Invocation.getIRGenOptions().FilePrefixMap);
} else {
std::string moduleToken =
Invocation.getModuleOutputPathForAtMostOnePrimary();
@@ -1760,7 +1761,8 @@ static void emitIndexDataForSourceFile(SourceFile *PrimarySourceFile,
opts.IndexIgnoreStdlib,
isDebugCompilation,
Invocation.getTargetTriple(),
*Instance.getDependencyTracker());
*Instance.getDependencyTracker(),
Invocation.getIRGenOptions().FilePrefixMap);
}
}