Skip to content

Commit e448e7f

Browse files
[Cache] Emit cache-hit remark for diagnostics
1 parent e89de6e commit e448e7f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/Frontend/CachingUtils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ bool replayCachedCompilerOutputs(
244244
Diag.diagnose(SourceLoc(), diag::error_replay_cached_diag,
245245
toString(std::move(E)));
246246
return false;
247+
} else {
248+
if (CacheRemarks)
249+
Diag.diagnose(SourceLoc(), diag::replay_output, "<cached-diagnostics>",
250+
DiagnosticsOutput->Key);
247251
}
248252

249253
// Replay the result only when everything is resolved.

test/CAS/cache_replay.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
// RUN: -module-name Test -o %t/test.o -cas-path %t/cas -allow-unstable-cache-key-for-testing 2>&1 | %FileCheck --allow-empty --check-prefix=SKIP-CACHE %s
1919

2020
// CACHE-MISS: remark: cache miss output file
21-
// CACHE-HIT: remark: replay output file
21+
// CACHE-HIT: remark: replay output file '<cached-diagnostics>': key 'llvmcas://{{.*}}'
22+
// CACHE-HIT: remark: replay output file '{{.*}}{{/|\\}}test.o': key 'llvmcas://{{.*}}'
23+
// CACHE-HIT: remark: replay output file '{{.*}}{{/|\\}}Test.swiftmodule': key 'llvmcas://{{.*}}'
2224
// SKIP-CACHE-NOT: remark:
2325

2426
func testFunc() {}

0 commit comments

Comments
 (0)