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:
Xi Ge
2019-08-27 17:39:15 -07:00
parent e9d22f25f7
commit 1e656662d9
9 changed files with 64 additions and 7 deletions

View File

@@ -42,8 +42,10 @@ class SerializedModuleLoaderBase : public ModuleLoader {
protected:
ASTContext &Ctx;
ModuleLoadingMode LoadMode;
ArrayRef<std::string> PreferInterfaceForModules;
SerializedModuleLoaderBase(ASTContext &ctx, DependencyTracker *tracker,
ModuleLoadingMode LoadMode);
ModuleLoadingMode LoadMode,
ArrayRef<std::string> PreferInterfaceForModules = {});
void collectVisibleTopLevelModuleNamesImpl(SmallVectorImpl<Identifier> &names,
StringRef extension) const;