Merge remote-tracking branch 'main' into 'rebranch'

This commit is contained in:
Evan Wilde
2023-10-16 23:00:12 -07:00
93 changed files with 2109 additions and 766 deletions

View File

@@ -457,9 +457,10 @@ void CompilerInstance::setupOutputBackend() {
// Mirror the output into CAS.
if (supportCaching()) {
auto CASOutputBackend = createSwiftCachingOutputBackend(
CASOutputBackend = createSwiftCachingOutputBackend(
*CAS, *ResultCache, *CompileJobBaseKey,
Invocation.getFrontendOptions().InputsAndOutputs);
Invocation.getFrontendOptions().InputsAndOutputs,
Invocation.getFrontendOptions().RequestedAction);
OutputBackend =
llvm::vfs::makeMirroringOutputBackend(OutputBackend, CASOutputBackend);
}
@@ -565,15 +566,18 @@ bool CompilerInstance::setUpVirtualFileSystemOverlays() {
if (!ClangOpts.BridgingHeaderPCHCacheKey.empty()) {
if (auto loadedBuffer = loadCachedCompileResultFromCacheKey(
getObjectStore(), getActionCache(), Diagnostics,
ClangOpts.BridgingHeaderPCHCacheKey, ClangOpts.BridgingHeader))
ClangOpts.BridgingHeaderPCHCacheKey, file_types::ID::TY_PCH,
ClangOpts.BridgingHeader))
MemFS->addFile(Invocation.getClangImporterOptions().BridgingHeader, 0,
std::move(loadedBuffer));
}
if (!Opts.InputFileKey.empty()) {
auto InputPath = Opts.InputsAndOutputs.getFilenameOfFirstInput();
auto Type = file_types::lookupTypeForExtension(
llvm::sys::path::extension(InputPath));
if (auto loadedBuffer = loadCachedCompileResultFromCacheKey(
getObjectStore(), getActionCache(), Diagnostics,
Opts.InputFileKey, InputPath))
Opts.InputFileKey, Type, InputPath))
MemFS->addFile(InputPath, 0, std::move(loadedBuffer));
}
llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayVFS =