mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Caching] Re-associate diagnostics cache key with InputFile
Change how cached diagnostics are stored inside the CAS. It used to be stored as a standalone entry for a frontend invocation in the cache and now it is switched to be associated with input files, stored together with other outputs like object files, etc. This enables cleaner Cache Replay APIs and future cached diagnostics that can be splitted up by file contribution.
This commit is contained in:
@@ -209,19 +209,15 @@ bool replayCachedCompilerOutputs(
|
||||
Outputs.try_emplace(ID, File);
|
||||
});
|
||||
|
||||
// Nothing to replay.
|
||||
if (Outputs.empty())
|
||||
return;
|
||||
// Add cached diagnostic entry for lookup. Output path doesn't matter here.
|
||||
Outputs.try_emplace(file_types::ID::TY_CachedDiagnostics,
|
||||
"<cached-diagnostics>");
|
||||
|
||||
return replayOutputsForInputFile(InputPath, Outputs);
|
||||
};
|
||||
|
||||
llvm::for_each(InputsAndOutputs.getAllInputs(), replayOutputFromInput);
|
||||
|
||||
replayOutputsForInputFile(
|
||||
"<cached-diagnostics>",
|
||||
{{file_types::ID::TY_CachedDiagnostics, "<cached-diagnostics>"}});
|
||||
|
||||
if (!CanReplayAllOutput)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user