[CAS] Full support for make-style dependencies file caching hit

Fully support make-style `.d` dependencies file output by making
following improvements:
* All correct dependency file render when cache hit for a different
  output file location. The dependency file should list the correct
  output path, not the stale output path for the initial compilation
* When enable a path prefix mapper to canonicalize the path, the
  dependency file should render the input file correctly as the input
  file path on disk.

rdar://132250067
This commit is contained in:
Steven Wu
2024-09-30 15:10:31 -07:00
parent 353a1c26d6
commit b326c55d82
11 changed files with 285 additions and 78 deletions

View File

@@ -40,11 +40,13 @@ createSwiftCachingOutputBackend(
/// Replay the output of the compilation from cache.
/// Return true if outputs are replayed, false otherwise.
bool replayCachedCompilerOutputs(
llvm::cas::ObjectStore &CAS, llvm::cas::ActionCache &Cache,
llvm::cas::ObjectRef BaseKey, DiagnosticEngine &Diag,
const FrontendInputsAndOutputs &InputsAndOutputs,
CachingDiagnosticsProcessor &CDP, bool CacheRemarks, bool UseCASBackend);
bool replayCachedCompilerOutputs(llvm::cas::ObjectStore &CAS,
llvm::cas::ActionCache &Cache,
llvm::cas::ObjectRef BaseKey,
DiagnosticEngine &Diag,
const FrontendOptions &Opts,
CachingDiagnosticsProcessor &CDP,
bool CacheRemarks, bool UseCASBackend);
/// Load the cached compile result from cache.
std::unique_ptr<llvm::MemoryBuffer> loadCachedCompileResultFromCacheKey(