ModuleInterface: refactor ModuleInterfaceChecker out of ModuleInterfaceLoader

This refactoring allows us to drop ModuleInterfaceLoader when explicit modules
are enabled. Before this change, the dependencies scanner needs the loader to be
present to access functionalities like collecting prebuilt module candidates.
This commit is contained in:
Xi Ge
2020-09-29 11:26:17 -07:00
parent 8920da22a6
commit 8ccee27db7
10 changed files with 117 additions and 91 deletions

View File

@@ -170,10 +170,9 @@ bool ModuleInterfaceBuilder::buildSwiftModuleInternal(
auto &SubInstance = *info.Instance;
auto subInvocation = SubInstance.getInvocation();
// Try building forwarding module first. If succeed, return.
if (static_cast<ModuleInterfaceLoader*>(SubInstance.getASTContext()
.getModuleInterfaceLoader())->tryEmitForwardingModule(moduleName,
interfacePath,
CompiledCandidates, OutPath)) {
if (SubInstance.getASTContext().getModuleInterfaceChecker()
->tryEmitForwardingModule(moduleName, interfacePath,
CompiledCandidates, OutPath)) {
return std::error_code();
}
FrontendOptions &FEOpts = subInvocation.getFrontendOptions();