Skip to content

Commit c282e9c

Browse files
[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.
1 parent 5bed6c4 commit c282e9c

24 files changed

+104
-82
lines changed

include/swift/Frontend/CachingUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ bool replayCachedCompilerOutputs(
3939
llvm::cas::ObjectStore &CAS, llvm::cas::ActionCache &Cache,
4040
llvm::cas::ObjectRef BaseKey, DiagnosticEngine &Diag,
4141
const FrontendInputsAndOutputs &InputsAndOutputs,
42-
CachingDiagnosticsProcessor &CDP);
42+
CachingDiagnosticsProcessor &CDP, bool CacheRemarks);
4343

4444
/// Load the cached compile result from cache.
4545
std::unique_ptr<llvm::MemoryBuffer> loadCachedCompileResultFromCacheKey(

include/swift/Frontend/FrontendOptions.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,14 @@ class FrontendOptions {
123123
/// The module for which we should verify all of the generic signatures.
124124
std::string VerifyGenericSignaturesInModule;
125125

126-
/// Use CAS.
127-
bool EnableCAS = false;
126+
/// Enable compiler caching.
127+
bool EnableCaching = false;
128+
129+
/// Enable compiler caching remarks.
130+
bool EnableCachingRemarks = false;
131+
132+
/// Skip replaying outputs from cache.
133+
bool CacheSkipReplay = false;
128134

129135
/// CASOptions
130136
clang::CASOptions CASOpts;

include/swift/Option/FrontendOptions.td

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,23 @@ def always_compile_output_files :
12171217
Flag<["-"], "always-compile-output-files">,
12181218
HelpText<"Always compile output files even it might not change the results">;
12191219

1220+
// CAS/Caching related options.
1221+
def allow_unstable_cache_key_for_testing: Flag<["-"], "allow-unstable-cache-key-for-testing">,
1222+
HelpText<"Allow compilation caching with unstable inputs for testing purpose">;
1223+
1224+
def bridging_header_pch_key : Separate<["-"], "bridging-header-pch-key">,
1225+
HelpText<"Cache Key for bridging header pch">;
1226+
1227+
def clang_include_tree: Flag<["-"], "clang-include-tree">,
1228+
HelpText<"Use clang include tree">;
1229+
1230+
def cas_fs: Separate<["-"], "cas-fs">,
1231+
HelpText<"Root CASID for CAS FileSystem">, MetaVarName<"<cas-id>">;
1232+
1233+
def clang_include_tree_root: Separate<["-"], "clang-include-tree-root">,
1234+
HelpText<"Clang Include Tree CASID">, MetaVarName<"<cas-id>">;
1235+
1236+
12201237
def experimental_spi_only_imports :
12211238
Flag<["-"], "experimental-spi-only-imports">,
12221239
HelpText<"Enable use of @_spiOnly imports">;

include/swift/Option/Options.td

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,6 +1812,18 @@ def gcc_toolchain: Separate<["-"], "gcc-toolchain">,
18121812
MetaVarName<"<path>">,
18131813
HelpText<"Specify a directory where the clang importer and clang linker can find headers and libraries">;
18141814

1815+
def cache_compile_job: Flag<["-"], "cache-compile-job">,
1816+
Flags<[FrontendOption, NewDriverOnlyOption]>,
1817+
HelpText<"Enable compiler caching">;
1818+
1819+
def cache_remarks: Flag<["-"], "cache-remarks">,
1820+
Flags<[FrontendOption, NewDriverOnlyOption]>,
1821+
HelpText<"Show remarks for compiler caching">;
1822+
1823+
def cache_disable_replay: Flag<["-"], "cache-disable-replay">,
1824+
Flags<[FrontendOption, NewDriverOnlyOption]>,
1825+
HelpText<"Skip loading the compilation result from cache">;
1826+
18151827
def cas_path: Separate<["-"], "cas-path">,
18161828
Flags<[FrontendOption, NewDriverOnlyOption]>,
18171829
HelpText<"Path to CAS">, MetaVarName<"<path>">;
@@ -1824,33 +1836,9 @@ def cas_plugin_option: Separate<["-"], "cas-plugin-option">,
18241836
Flags<[FrontendOption, NewDriverOnlyOption]>,
18251837
HelpText<"Option pass to CAS Plugin">, MetaVarName<"<name>=<option>">;
18261838

1827-
def allow_unstable_cache_key_for_testing: Flag<["-"], "allow-unstable-cache-key-for-testing">,
1828-
Flags<[FrontendOption, HelpHidden, NoDriverOption]>,
1829-
HelpText<"Allow compilation caching with unstable inputs for testing purpose">;
1830-
1831-
def bridging_header_pch_key : Separate<["-"], "bridging-header-pch-key">,
1832-
Flags<[FrontendOption, HelpHidden, ArgumentIsPath]>,
1833-
HelpText<"Cache Key for bridging header pch">;
1834-
1835-
def clang_include_tree: Flag<["-"], "clang-include-tree">,
1836-
Flags<[FrontendOption, NoDriverOption]>,
1837-
HelpText<"Use clang include tree">;
1838-
18391839

18401840
// END ONLY SUPPORTED IN NEW DRIVER
18411841

1842-
def enable_cas: Flag<["-"], "enable-cas">,
1843-
Flags<[FrontendOption, NoDriverOption]>,
1844-
HelpText<"Enable CAS for swift-frontend">;
1845-
1846-
def cas_fs: Separate<["-"], "cas-fs">,
1847-
Flags<[FrontendOption, NoDriverOption]>,
1848-
HelpText<"Root CASID for CAS FileSystem">, MetaVarName<"<cas-id>">;
1849-
1850-
def clang_include_tree_root: Separate<["-"], "clang-include-tree-root">,
1851-
Flags<[FrontendOption, NoDriverOption]>,
1852-
HelpText<"Clang Include Tree CASID">, MetaVarName<"<cas-id>">;
1853-
18541842

18551843
def plugin_search_Group : OptionGroup<"<plugin search options>">;
18561844

lib/AST/ModuleDependencies.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ void SwiftDependencyScanningService::overlaySharedFilesystemCacheForCompilation(
419419

420420
bool SwiftDependencyScanningService::setupCachingDependencyScanningService(
421421
CompilerInstance &Instance) {
422-
if (!Instance.getInvocation().getFrontendOptions().EnableCAS)
422+
if (!Instance.getInvocation().getFrontendOptions().EnableCaching)
423423
return false;
424424

425425
if (CASOpts) {

lib/DependencyScan/ScanDependencies.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ static llvm::Error resolveExplicitModuleInputs(
421421
dependencyInfoCopy.updateCommandLine(commandLine);
422422

423423
// Handle CAS options.
424-
if (instance.getInvocation().getFrontendOptions().EnableCAS) {
424+
if (instance.getInvocation().getFrontendOptions().EnableCaching) {
425425
// Merge CASFS from clang dependency.
426426
auto &CASFS = cache.getScanService().getSharedCachingFS();
427427
auto &CAS = CASFS.getCAS();

lib/DriverTool/swift_cache_tool_main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class SwiftCacheToolInvocation {
194194
MainExecutablePath))
195195
return true;
196196

197-
if (!Invocation.getFrontendOptions().EnableCAS) {
197+
if (!Invocation.getFrontendOptions().EnableCaching) {
198198
llvm::errs() << "Requested command-line arguments do not enable CAS\n";
199199
return true;
200200
}

lib/Frontend/ArgsToFrontendOptionsConverter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,9 @@ bool ArgsToFrontendOptionsConverter::convert(
351351
Opts.BlocklistConfigFilePaths.push_back(A);
352352
}
353353

354-
Opts.EnableCAS = Args.hasArg(OPT_enable_cas);
354+
Opts.EnableCaching = Args.hasArg(OPT_cache_compile_job);
355+
Opts.EnableCachingRemarks = Args.hasArg(OPT_cache_remarks);
356+
Opts.CacheSkipReplay = Args.hasArg(OPT_cache_disable_replay);
355357
Opts.CASOpts.CASPath =
356358
Args.getLastArgValue(OPT_cas_path, llvm::cas::getDefaultOnDiskCASPath());
357359
Opts.CASOpts.PluginPath = Args.getLastArgValue(OPT_cas_plugin_path);
@@ -365,7 +367,7 @@ bool ArgsToFrontendOptionsConverter::convert(
365367
Opts.CASFSRootIDs = Args.getAllArgValues(OPT_cas_fs);
366368
Opts.ClangIncludeTrees = Args.getAllArgValues(OPT_clang_include_tree_root);
367369

368-
if (Opts.EnableCAS && Opts.CASFSRootIDs.empty() &&
370+
if (Opts.EnableCaching && Opts.CASFSRootIDs.empty() &&
369371
Opts.ClangIncludeTrees.empty() &&
370372
FrontendOptions::supportCompilationCaching(Opts.RequestedAction)) {
371373
if (!Args.hasArg(OPT_allow_unstable_cache_key_for_testing)) {

lib/Frontend/CachedDiagnostics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ CachingDiagnosticsProcessor::CachingDiagnosticsProcessor(
728728
: Impl(*new Implementation(Instance)) {
729729
Impl.serializedOutputCallback = [&](StringRef Output) {
730730
LLVM_DEBUG(llvm::dbgs() << Output << "\n";);
731-
if (!Instance.getInvocation().getFrontendOptions().EnableCAS)
731+
if (!Instance.getInvocation().getFrontendOptions().EnableCaching)
732732
return false;
733733

734734
// compress the YAML file.

lib/Frontend/CachingUtils.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ createSwiftCachingOutputBackend(
142142
bool replayCachedCompilerOutputs(
143143
ObjectStore &CAS, ActionCache &Cache, ObjectRef BaseKey,
144144
DiagnosticEngine &Diag, const FrontendInputsAndOutputs &InputsAndOutputs,
145-
CachingDiagnosticsProcessor &CDP) {
145+
CachingDiagnosticsProcessor &CDP, bool CacheRemarks) {
146146
clang::cas::CompileJobResultSchema Schema(CAS);
147147
bool CanReplayAllOutput = true;
148148
struct OutputEntry {
@@ -173,8 +173,9 @@ bool replayCachedCompilerOutputs(
173173
return None;
174174
}
175175
if (!*Lookup) {
176-
Diag.diagnose(SourceLoc(), diag::output_cache_miss, OutputPath,
177-
OutputKeyID.toString());
176+
if (CacheRemarks)
177+
Diag.diagnose(SourceLoc(), diag::output_cache_miss, OutputPath,
178+
OutputKeyID.toString());
178179
return None;
179180
}
180181
auto OutputRef = CAS.getReference(**Lookup);
@@ -261,7 +262,8 @@ bool replayCachedCompilerOutputs(
261262
toString(std::move(E)));
262263
continue;
263264
}
264-
Diag.diagnose(SourceLoc(), diag::replay_output, Output.Path, Output.Key);
265+
if (CacheRemarks)
266+
Diag.diagnose(SourceLoc(), diag::replay_output, Output.Path, Output.Key);
265267
}
266268

267269
return true;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1505,7 +1505,7 @@ static bool ParseClangImporterArgs(ClangImporterOptions &Opts,
15051505

15061506
// Forward the FrontendOptions to clang importer option so it can be
15071507
// accessed when creating clang module compilation invocation.
1508-
if (FrontendOpts.EnableCAS)
1508+
if (FrontendOpts.EnableCaching)
15091509
Opts.CASOpts = FrontendOpts.CASOpts;
15101510

15111511
return false;

lib/Frontend/Frontend.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ void CompilerInstance::setupDependencyTrackerIfNeeded() {
403403

404404
bool CompilerInstance::setupCASIfNeeded(ArrayRef<const char *> Args) {
405405
const auto &Opts = getInvocation().getFrontendOptions();
406-
if (!Opts.EnableCAS)
406+
if (!Opts.EnableCaching)
407407
return false;
408408

409409
auto MaybeDB= Opts.CASOpts.getOrCreateDatabases();
@@ -520,7 +520,7 @@ bool CompilerInstance::setup(const CompilerInvocation &Invoke,
520520
}
521521

522522
bool CompilerInstance::setUpVirtualFileSystemOverlays() {
523-
if (Invocation.getFrontendOptions().EnableCAS &&
523+
if (Invocation.getFrontendOptions().EnableCaching &&
524524
(!Invocation.getFrontendOptions().CASFSRootIDs.empty() ||
525525
!Invocation.getFrontendOptions().ClangIncludeTrees.empty())) {
526526
// Set up CASFS as BaseFS.
@@ -537,7 +537,7 @@ bool CompilerInstance::setUpVirtualFileSystemOverlays() {
537537

538538
// If we have a bridging header cache key, try load it now and overlay it.
539539
if (!Invocation.getClangImporterOptions().BridgingHeaderPCHCacheKey.empty() &&
540-
Invocation.getFrontendOptions().EnableCAS) {
540+
Invocation.getFrontendOptions().EnableCaching) {
541541
auto loadedBridgingBuffer = loadCachedCompileResultFromCacheKey(
542542
getObjectStore(), getActionCache(), Diagnostics,
543543
Invocation.getClangImporterOptions().BridgingHeaderPCHCacheKey,
@@ -681,7 +681,7 @@ bool CompilerInstance::setUpModuleLoaders() {
681681
if (ExplicitModuleBuild ||
682682
!Invocation.getSearchPathOptions().ExplicitSwiftModuleMap.empty() ||
683683
!Invocation.getSearchPathOptions().ExplicitSwiftModuleInputs.empty()) {
684-
if (Invocation.getFrontendOptions().EnableCAS)
684+
if (Invocation.getFrontendOptions().EnableCaching)
685685
ESML = ExplicitCASModuleLoader::create(
686686
*Context, getObjectStore(), getActionCache(), getDependencyTracker(),
687687
MLM, Invocation.getSearchPathOptions().ExplicitSwiftModuleMap,
@@ -1106,7 +1106,7 @@ bool CompilerInstance::canImportCxxShim() const {
11061106
}
11071107

11081108
bool CompilerInstance::supportCaching() const {
1109-
if (!Invocation.getFrontendOptions().EnableCAS)
1109+
if (!Invocation.getFrontendOptions().EnableCaching)
11101110
return false;
11111111

11121112
return FrontendOptions::supportCompilationCaching(

lib/FrontendTool/FrontendTool.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,8 @@ static bool performAction(CompilerInstance &Instance,
13941394
/// Return true if all the outputs are fetched from cache. Otherwise, return
13951395
/// false and will not replay any output.
13961396
static bool tryReplayCompilerResults(CompilerInstance &Instance) {
1397-
if (!Instance.supportCaching())
1397+
if (!Instance.supportCaching() ||
1398+
Instance.getInvocation().getFrontendOptions().CacheSkipReplay)
13981399
return false;
13991400

14001401
assert(Instance.getCompilerBaseKey() &&
@@ -1409,7 +1410,8 @@ static bool tryReplayCompilerResults(CompilerInstance &Instance) {
14091410
bool replayed = replayCachedCompilerOutputs(
14101411
Instance.getObjectStore(), Instance.getActionCache(),
14111412
*Instance.getCompilerBaseKey(), Instance.getDiags(),
1412-
Instance.getInvocation().getFrontendOptions().InputsAndOutputs, *CDP);
1413+
Instance.getInvocation().getFrontendOptions().InputsAndOutputs, *CDP,
1414+
Instance.getInvocation().getFrontendOptions().EnableCachingRemarks);
14131415

14141416
// If we didn't replay successfully, re-start capture.
14151417
if (!replayed)

test/CAS/binary_module_deps.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
// RUN: %target-swift-frontend -emit-module -module-cache-path %t/clang-module-cache %S/../ScanDependencies/Inputs/Swift/E.swiftinterface -o %t/E.swiftmodule -I %S/../ScanDependencies/Inputs/CHeaders -I %S/../ScanDependencies/Inputs/Swift -swift-version 4
88
// RUN: %target-swift-frontend -emit-module -module-cache-path %t/clang-module-cache %S/../ScanDependencies/Inputs/Swift/A.swiftinterface -o %t/A.swiftmodule -I %S/../ScanDependencies/Inputs/CHeaders -I %S/../ScanDependencies/Inputs/Swift -swift-version 4
9-
// RUN: %target-swift-frontend -scan-dependencies -module-cache-path %t/clang-module-cache %s -o %t/deps.json -I %t -swift-version 4 -enable-cas -cas-path %t/cas
9+
// RUN: %target-swift-frontend -scan-dependencies -module-cache-path %t/clang-module-cache %s -o %t/deps.json -I %t -swift-version 4 -cache-compile-job -cas-path %t/cas
1010
// RUN: %FileCheck %s -DTEMP=%t < %t/deps.json
1111

1212
/// Test binary module key: binary module key is the CASID of itself.

test/CAS/cache_key_compute.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010

1111
/// Check few working cases.
1212
// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-base-key -- \
13-
// RUN: %target-swift-frontend -enable-cas %s -c -allow-unstable-cache-key-for-testing > %t1.casid
13+
// RUN: %target-swift-frontend -cache-compile-job %s -c -allow-unstable-cache-key-for-testing > %t1.casid
1414
/// A different CAS doesn't affect base key.
1515
// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-base-key -- \
16-
// RUN: %target-swift-frontend -enable-cas %s -c -allow-unstable-cache-key-for-testing -cas-path %t > %t2.casid
16+
// RUN: %target-swift-frontend -cache-compile-job %s -c -allow-unstable-cache-key-for-testing -cas-path %t > %t2.casid
1717
/// Output path doesn't affect base key.
1818
// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-base-key -- \
19-
// RUN: %target-swift-frontend -enable-cas %s -c -allow-unstable-cache-key-for-testing -o %t/test.o > %t3.casid
19+
// RUN: %target-swift-frontend -cache-compile-job %s -c -allow-unstable-cache-key-for-testing -o %t/test.o > %t3.casid
2020
/// Add -D will change.
2121
// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-base-key -- \
22-
// RUN: %target-swift-frontend -enable-cas %s -c -allow-unstable-cache-key-for-testing -DTEST > %t4.casid
22+
// RUN: %target-swift-frontend -cache-compile-job %s -c -allow-unstable-cache-key-for-testing -DTEST > %t4.casid
2323

2424
// RUN: diff %t1.casid %t2.casid
2525
// RUN: diff %t1.casid %t3.casid
@@ -31,17 +31,17 @@
3131
// RUN: cp %s %t/temp.swift
3232
// RUN: echo "%t/temp.swift" > %t/filelist-3
3333
// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-base-key -- \
34-
// RUN: %target-swift-frontend -enable-cas -filelist %t/filelist-1 -c -allow-unstable-cache-key-for-testing > %t5.casid
34+
// RUN: %target-swift-frontend -cache-compile-job -filelist %t/filelist-1 -c -allow-unstable-cache-key-for-testing > %t5.casid
3535
// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-base-key -- \
36-
// RUN: %target-swift-frontend -enable-cas -filelist %t/filelist-2 -c -allow-unstable-cache-key-for-testing > %t6.casid
36+
// RUN: %target-swift-frontend -cache-compile-job -filelist %t/filelist-2 -c -allow-unstable-cache-key-for-testing > %t6.casid
3737
// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-base-key -- \
38-
// RUN: %target-swift-frontend -enable-cas -filelist %t/filelist-3 -c -allow-unstable-cache-key-for-testing > %t7.casid
38+
// RUN: %target-swift-frontend -cache-compile-job -filelist %t/filelist-3 -c -allow-unstable-cache-key-for-testing > %t7.casid
3939
// RUN: diff %t5.casid %t6.casid
4040
// RUN: not diff %t5.casid %t7.casid
4141

4242
/// Test output keys.
4343
// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- \
44-
// RUN: %target-swift-frontend -enable-cas %s -emit-module -c -emit-dependencies \
44+
// RUN: %target-swift-frontend -cache-compile-job %s -emit-module -c -emit-dependencies \
4545
// RUN: -emit-tbd -emit-tbd-path %t/test.tbd -o %t/test.o -allow-unstable-cache-key-for-testing | %FileCheck %s
4646

4747
// CHECK: test.o

test/CAS/cache_replay.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@
22

33
/// Run the command first time, expect cache miss.
44
/// FIXME: This command doesn't use `-cas-fs` so it is not a good cache entry. It is currently allowed so it is easier to write tests.
5-
// RUN: %target-swift-frontend -enable-cas %s -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies \
5+
// RUN: %target-swift-frontend -cache-compile-job -cache-remarks %s -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies \
66
// RUN: -module-name Test -o %t/test.o -cas-path %t/cas -allow-unstable-cache-key-for-testing 2>&1 | %FileCheck --check-prefix=CACHE-MISS %s
77

88
/// Expect cache hit for second time.
9-
// RUN: %target-swift-frontend -enable-cas %s -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies \
9+
// RUN: %target-swift-frontend -cache-compile-job -cache-remarks %s -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies \
1010
// RUN: -module-name Test -o %t/test.o -cas-path %t/cas -allow-unstable-cache-key-for-testing 2>&1 | %FileCheck --check-prefix=CACHE-HIT %s
1111

1212
/// Expect cache hit a subset of outputs.
13-
// RUN: %target-swift-frontend -enable-cas %s -emit-module -emit-module-path %t/Test.swiftmodule -c \
13+
// RUN: %target-swift-frontend -cache-compile-job -cache-remarks %s -emit-module -emit-module-path %t/Test.swiftmodule -c \
1414
// RUN: -module-name Test -o %t/test.o -cas-path %t/cas -allow-unstable-cache-key-for-testing 2>&1 | %FileCheck --check-prefix=CACHE-HIT %s
1515

16+
/// Skip cache
17+
// RUN: %target-swift-frontend -cache-compile-job -cache-remarks -cache-disable-replay %s -emit-module -emit-module-path %t/Test.swiftmodule -c \
18+
// 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
19+
1620
// CACHE-MISS: remark: cache miss output file
1721
// CACHE-HIT: remark: replay output file
22+
// SKIP-CACHE-NOT: remark:
1823

1924
func testFunc() {}

test/CAS/cached_diagnostics.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// RUN: %empty-directory(%t)
22

3-
// RUN: %target-swift-frontend -c -enable-cas -cas-path %t/cas -allow-unstable-cache-key-for-testing %s \
3+
// RUN: %target-swift-frontend -c -cache-compile-job -cas-path %t/cas -allow-unstable-cache-key-for-testing %s \
44
// RUN: -import-objc-header %S/Inputs/objc.h -emit-module -emit-module-path %t/test.swiftmodule 2>&1 | %FileCheck %s
5-
// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- %target-swift-frontend -c -enable-cas -cas-path %t/cas -allow-unstable-cache-key-for-testing %s \
5+
// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- %target-swift-frontend -c -cache-compile-job -cas-path %t/cas -allow-unstable-cache-key-for-testing %s \
66
// RUN: -import-objc-header %S/Inputs/objc.h -emit-module -emit-module-path %t/test.swiftmodule > %t/cache_key.json
7-
// RUN: %cache-tool -cas-path %t/cas -cache-tool-action render-diags %t/cache_key.json -- %target-swift-frontend -c -enable-cas -cas-path %t/cas -allow-unstable-cache-key-for-testing %s \
7+
// RUN: %cache-tool -cas-path %t/cas -cache-tool-action render-diags %t/cache_key.json -- %target-swift-frontend -c -cache-compile-job -cas-path %t/cas -allow-unstable-cache-key-for-testing %s \
88
// RUN: -import-objc-header %S/Inputs/objc.h -emit-module -emit-module-path %t/test.swiftmodule 2>&1 | %FileCheck %s
99

1010
#warning("this is a warning") // expected-warning {{this is a warning}}
@@ -13,7 +13,7 @@
1313
// CHECK: warning: this is a warning
1414

1515
/// Check other DiagnosticConsumers.
16-
// RUN: %target-swift-frontend -c -enable-cas -cas-path %t/cas -allow-unstable-cache-key-for-testing %s \
16+
// RUN: %target-swift-frontend -c -cache-compile-job -cas-path %t/cas -allow-unstable-cache-key-for-testing %s \
1717
// RUN: -typecheck -serialize-diagnostics -serialize-diagnostics-path %t/test.diag -verify
1818
// RUN: %FileCheck %s -check-prefix CHECK-SERIALIZED <%t/test.diag
1919

0 commit comments

Comments
 (0)