2828#include " swift/Frontend/CompileJobCacheResult.h"
2929#include " swift/Frontend/DiagnosticHelper.h"
3030#include " swift/Frontend/Frontend.h"
31+ #include " swift/Frontend/MakeStyleDependencies.h"
3132#include " swift/Frontend/PrintingDiagnosticConsumer.h"
3233#include " swift/Option/Options.h"
3334#include " clang/CAS/CASOptions.h"
@@ -938,6 +939,7 @@ static llvm::Error replayCompilation(SwiftScanReplayInstance &Instance,
938939 struct OutputEntry {
939940 std::string Path;
940941 llvm::cas::ObjectProxy Proxy;
942+ file_types::ID Kind;
941943 };
942944 SmallVector<OutputEntry> OutputProxies;
943945 std::optional<llvm::cas::ObjectProxy> DiagnosticsOutput;
@@ -964,7 +966,7 @@ static llvm::Error replayCompilation(SwiftScanReplayInstance &Instance,
964966 DiagnosticsOutput = std::move (*Proxy);
965967 } else
966968 OutputProxies.emplace_back (
967- OutputEntry{OutputPath->second , std::move (*Proxy)});
969+ OutputEntry{OutputPath->second , std::move (*Proxy), Kind });
968970 return Error::success ();
969971 }))
970972 return Err;
@@ -1011,6 +1013,13 @@ static llvm::Error replayCompilation(SwiftScanReplayInstance &Instance,
10111013 if (auto E = Schema->serializeObjectFile (Output.Proxy , *File))
10121014 Inst.getDiags ().diagnose (SourceLoc (), diag::error_mccas,
10131015 toString (std::move (E)));
1016+ } else if (Output.Kind == file_types::ID::TY_Dependencies) {
1017+ if (emitMakeDependenciesFromSerializedBuffer (
1018+ Output.Proxy .getData (), *File,
1019+ Inst.getInvocation ().getFrontendOptions (), Input,
1020+ Inst.getDiags ()))
1021+ Inst.getDiags ().diagnose (SourceLoc (), diag::cache_replay_failed,
1022+ " failed to emit dependency file" );
10141023 } else
10151024 *File << Output.Proxy .getData ();
10161025 if (auto E = File->keep ())
0 commit comments