mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Invoke Explicit Interface Build when '-explicit-interface-module-build' is specified on a '-compile-module-from-interface' frontend action, using the CompilerInstance instantiated directly from the command-line in order to build the module.
This commit is contained in:
@@ -422,17 +422,26 @@ static bool buildModuleFromInterface(CompilerInstance &Instance) {
|
||||
StringRef PrebuiltCachePath = FEOpts.PrebuiltModuleCachePath;
|
||||
ModuleInterfaceLoaderOptions LoaderOpts(FEOpts);
|
||||
StringRef ABIPath = Instance.getPrimarySpecificPathsForAtMostOnePrimary()
|
||||
.SupplementaryOutputs.ABIDescriptorOutputPath;
|
||||
|
||||
|
||||
|
||||
return ModuleInterfaceLoader::buildSwiftModuleFromSwiftInterface(
|
||||
.SupplementaryOutputs.ABIDescriptorOutputPath;
|
||||
|
||||
// If an explicit interface build was requested, bypass the creation of a new
|
||||
// sub-instance from the interface which will build it in a separate thread,
|
||||
// and isntead directly use the current \c Instance for compilation.
|
||||
if (FEOpts.ExplicitInterfaceBuild)
|
||||
return ModuleInterfaceLoader::buildExplicitSwiftModuleFromSwiftInterface(
|
||||
Instance, Invocation.getClangModuleCachePath(),
|
||||
FEOpts.BackupModuleInterfaceDir, PrebuiltCachePath, ABIPath, InputPath,
|
||||
Invocation.getOutputFilename(),
|
||||
FEOpts.SerializeModuleInterfaceDependencyHashes,
|
||||
Invocation.getSearchPathOptions().CandidateCompiledModules);
|
||||
else
|
||||
return ModuleInterfaceLoader::buildSwiftModuleFromSwiftInterface(
|
||||
Instance.getSourceMgr(), Instance.getDiags(),
|
||||
Invocation.getSearchPathOptions(), Invocation.getLangOptions(),
|
||||
Invocation.getClangImporterOptions(),
|
||||
Invocation.getClangModuleCachePath(), PrebuiltCachePath,
|
||||
FEOpts.BackupModuleInterfaceDir,
|
||||
Invocation.getModuleName(), InputPath, Invocation.getOutputFilename(), ABIPath,
|
||||
FEOpts.BackupModuleInterfaceDir, Invocation.getModuleName(), InputPath,
|
||||
Invocation.getOutputFilename(), ABIPath,
|
||||
FEOpts.SerializeModuleInterfaceDependencyHashes,
|
||||
FEOpts.shouldTrackSystemDependencies(), LoaderOpts,
|
||||
RequireOSSAModules_t(Invocation.getSILOptions()));
|
||||
|
||||
Reference in New Issue
Block a user