mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Frontend: add a front-end option to specify module names for which we prefer to loading via interfaces
ABI checker imports Swift frameworks by using Swift interfaces for various reasons. The existing way of controlling preferred importing mechanism is by setting an environment variable (SWIFT_FORCE_MODULE_LOADING), which may lead to performance issues because the stdlib could also be loaded in this way. This patch adds a new front-end option to specify module names for which we prefer to importing via Swift interface. The option currently is only accessible via swift-api-digester. rdar://54559888
This commit is contained in:
@@ -1435,11 +1435,14 @@ std::error_code ParseableInterfaceModuleLoader::findModuleFilesInDirectory(
|
||||
}
|
||||
|
||||
// Create an instance of the Impl to do the heavy lifting.
|
||||
auto ModuleName = ModuleID.first.str();
|
||||
ParseableInterfaceModuleLoaderImpl Impl(
|
||||
Ctx, ModPath, InPath, ModuleID.first.str(),
|
||||
Ctx, ModPath, InPath, ModuleName,
|
||||
CacheDir, PrebuiltCacheDir, ModuleID.second,
|
||||
RemarkOnRebuildFromInterface, dependencyTracker,
|
||||
LoadMode);
|
||||
llvm::is_contained(PreferInterfaceForModules,
|
||||
ModuleName)?
|
||||
ModuleLoadingMode::PreferParseable : LoadMode);
|
||||
|
||||
// Ask the impl to find us a module that we can load or give us an error
|
||||
// telling us that we couldn't load it.
|
||||
|
||||
Reference in New Issue
Block a user