Virtualize swift compiler outputs (#63206)

Using a virutal output backend to capture all the outputs from
swift-frontend invocation. This allows redirecting and/or mirroring
compiler outputs to multiple location using different OutputBackend.

As an example usage for the virtual outputs, teach swift compiler to
check its output determinism by running the compiler invocation
twice and compare the hash of all its outputs.

Virtual output will be used to enable caching in the future.
This commit is contained in:
Steven Wu
2023-04-05 23:34:37 +08:00
committed by GitHub
parent 829491b230
commit 09b8af86fb
52 changed files with 690 additions and 327 deletions

View File

@@ -18,6 +18,9 @@
namespace llvm {
class MemoryBuffer;
namespace vfs{
class OutputBackend;
}
}
namespace swift {
@@ -187,6 +190,7 @@ bool readInterModuleDependenciesCache(llvm::StringRef path,
/// Tries to write the dependency graph to the given path name.
/// Returns true if there was an error.
bool writeInterModuleDependenciesCache(DiagnosticEngine &diags,
llvm::vfs::OutputBackend &backend,
llvm::StringRef path,
const SwiftDependencyScanningService &cache);