Skip to content

Commit dd4104c

Browse files
[Caching] Use subInvocation to verify interface
The interface verification needs to read some command-line from the interface file so it needs to be built inside sub-invocation. rdar://122423965
1 parent fb866f7 commit dd4104c

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,7 @@ static bool buildModuleFromInterface(CompilerInstance &Instance) {
418418
// currently we need to ensure it still reads the flags written out
419419
// in the .swiftinterface file itself. Instead, creation of that
420420
// job should incorporate those flags.
421-
if (FEOpts.ExplicitInterfaceBuild &&
422-
!(FEOpts.isTypeCheckAction() &&
423-
!Invocation.getCASOptions().EnableCaching))
421+
if (FEOpts.ExplicitInterfaceBuild && !(FEOpts.isTypeCheckAction()))
424422
return ModuleInterfaceLoader::buildExplicitSwiftModuleFromSwiftInterface(
425423
Instance, Invocation.getClangModuleCachePath(),
426424
FEOpts.BackupModuleInterfaceDir, PrebuiltCachePath, ABIPath, InputPath,

test/CAS/cas-explicit-module-map.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
// RUN: -cache-compile-job -cas-path %t/cas -swift-version 5 -enable-library-evolution \
3737
// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \
3838
// RUN: -explicit-interface-module-build -Rcache-compile-job @%t/MyApp.cmd -input-file-key @%t/key 2>&1 \
39-
// RUN: | %FileCheck %s --check-prefix=VERIFY-OUTPUT --check-prefix=CACHE-MISS
39+
// RUN: | %FileCheck %s --check-prefix=CACHE-MISS
4040
// RUN: %target-swift-frontend -typecheck-module-from-interface %t/Foo.swiftinterface -disable-implicit-swift-modules \
4141
// RUN: -module-cache-path %t.module-cache -explicit-swift-module-map-file @%t/map.casid \
4242
// RUN: -cache-compile-job -cas-path %t/cas -swift-version 5 -enable-library-evolution \
4343
// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \
4444
// RUN: -explicit-interface-module-build -Rcache-compile-job @%t/MyApp.cmd -input-file-key @%t/key 2>&1 \
45-
// RUN: | %FileCheck %s --check-prefix=VERIFY-OUTPUT --check-prefix=CACHE-HIT
45+
// RUN: | %FileCheck %s --check-prefix=CACHE-HIT
4646

4747
// CACHE-MISS: remark: cache miss for input
4848
// VERIFY-OUTPUT: warning: module 'B' was not compiled with library evolution support

0 commit comments

Comments
 (0)