mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CAS] Consolidate compile cache flags
Rename `-enable-cas` to `-compile-cache-job` to align with clang option names and promote that to a new driver only flag. Few other additions to driver flag for caching behaviors: * `-compile-cache-remarks`: now cache hit/miss remarks are guarded behind this flag * `-compile-cache-skip`: skip replaying from the cache. Useful as a debugging tool to do the compilation using CAS inputs even the output is a hit from the cache.
This commit is contained in:
@@ -142,7 +142,7 @@ createSwiftCachingOutputBackend(
|
||||
bool replayCachedCompilerOutputs(
|
||||
ObjectStore &CAS, ActionCache &Cache, ObjectRef BaseKey,
|
||||
DiagnosticEngine &Diag, const FrontendInputsAndOutputs &InputsAndOutputs,
|
||||
CachingDiagnosticsProcessor &CDP) {
|
||||
CachingDiagnosticsProcessor &CDP, bool CacheRemarks) {
|
||||
clang::cas::CompileJobResultSchema Schema(CAS);
|
||||
bool CanReplayAllOutput = true;
|
||||
struct OutputEntry {
|
||||
@@ -173,8 +173,9 @@ bool replayCachedCompilerOutputs(
|
||||
return None;
|
||||
}
|
||||
if (!*Lookup) {
|
||||
Diag.diagnose(SourceLoc(), diag::output_cache_miss, OutputPath,
|
||||
OutputKeyID.toString());
|
||||
if (CacheRemarks)
|
||||
Diag.diagnose(SourceLoc(), diag::output_cache_miss, OutputPath,
|
||||
OutputKeyID.toString());
|
||||
return None;
|
||||
}
|
||||
auto OutputRef = CAS.getReference(**Lookup);
|
||||
@@ -261,7 +262,8 @@ bool replayCachedCompilerOutputs(
|
||||
toString(std::move(E)));
|
||||
continue;
|
||||
}
|
||||
Diag.diagnose(SourceLoc(), diag::replay_output, Output.Path, Output.Key);
|
||||
if (CacheRemarks)
|
||||
Diag.diagnose(SourceLoc(), diag::replay_output, Output.Path, Output.Key);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user