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:
@@ -150,6 +150,15 @@ std::string FrontendInputsAndOutputs::getStatsFileMangledInputName() const {
|
||||
return isWholeModule() ? "all" : firstPrimaryInput().getFileName();
|
||||
}
|
||||
|
||||
const InputFile &
|
||||
FrontendInputsAndOutputs::getFirstOutputProducingInput() const {
|
||||
// Get the first input file that produces the output file. That is currently
|
||||
// used to compute with input should the cached diagnostics be associated
|
||||
// with. The first output producing input file is the first input if using
|
||||
// whole module, or first primary input if not using whole module.
|
||||
return isWholeModule() ? firstInput() : firstPrimaryInput();
|
||||
}
|
||||
|
||||
bool FrontendInputsAndOutputs::isInputPrimary(StringRef file) const {
|
||||
return primaryInputNamed(file) != nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user