Skip to content

Commit cead485

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 cead485

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,6 +2054,10 @@ InterfaceSubContextDelegateImpl::runInSubCompilerInstance(StringRef moduleName,
20542054
subInstance.addDiagnosticConsumer(&noopConsumer);
20552055
}
20562056

2057+
// If doing typecheck, emit warnings.
2058+
if (subInvocation.getFrontendOptions().isTypeCheckAction())
2059+
subInvocation.getDiagnosticOptions().SuppressWarnings = false;
2060+
20572061
std::string InstanceSetupError;
20582062
if (subInstance.setup(subInvocation, InstanceSetupError)) {
20592063
return std::make_error_code(std::errc::not_supported);

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,

0 commit comments

Comments
 (0)