Skip to content

ModuleLoader: move PreferInterfaceForModules from SerializedModuleLoaderBase to ParseableInterfaceModuleLoader, NFC #27013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions include/swift/Frontend/ParseableInterfaceModuleLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,16 @@ class ParseableInterfaceModuleLoader : public SerializedModuleLoaderBase {
DependencyTracker *tracker, ModuleLoadingMode loadMode,
ArrayRef<std::string> PreferInterfaceForModules,
bool RemarkOnRebuildFromInterface)
: SerializedModuleLoaderBase(ctx, tracker, loadMode, PreferInterfaceForModules),
: SerializedModuleLoaderBase(ctx, tracker, loadMode),
CacheDir(cacheDir), PrebuiltCacheDir(prebuiltCacheDir),
RemarkOnRebuildFromInterface(RemarkOnRebuildFromInterface)
RemarkOnRebuildFromInterface(RemarkOnRebuildFromInterface),
PreferInterfaceForModules(PreferInterfaceForModules)
{}

std::string CacheDir;
std::string PrebuiltCacheDir;
bool RemarkOnRebuildFromInterface;
ArrayRef<std::string> PreferInterfaceForModules;

std::error_code findModuleFilesInDirectory(
AccessPathElem ModuleID, StringRef DirPath, StringRef ModuleFilename,
Expand Down
4 changes: 1 addition & 3 deletions include/swift/Serialization/SerializedModuleLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ class SerializedModuleLoaderBase : public ModuleLoader {
protected:
ASTContext &Ctx;
ModuleLoadingMode LoadMode;
ArrayRef<std::string> PreferInterfaceForModules;
SerializedModuleLoaderBase(ASTContext &ctx, DependencyTracker *tracker,
ModuleLoadingMode LoadMode,
ArrayRef<std::string> PreferInterfaceForModules = {});
ModuleLoadingMode LoadMode);

void collectVisibleTopLevelModuleNamesImpl(SmallVectorImpl<Identifier> &names,
StringRef extension) const;
Expand Down
6 changes: 2 additions & 4 deletions lib/Serialization/SerializedModuleLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,8 @@ Optional<bool> forEachModuleSearchPath(

// Defined out-of-line so that we can see ~ModuleFile.
SerializedModuleLoaderBase::SerializedModuleLoaderBase(
ASTContext &ctx, DependencyTracker *tracker, ModuleLoadingMode loadMode,
ArrayRef<std::string> PreferInterfaceForModules)
: ModuleLoader(tracker), Ctx(ctx), LoadMode(loadMode),
PreferInterfaceForModules(PreferInterfaceForModules) {}
ASTContext &ctx, DependencyTracker *tracker, ModuleLoadingMode loadMode)
: ModuleLoader(tracker), Ctx(ctx), LoadMode(loadMode) {}

SerializedModuleLoaderBase::~SerializedModuleLoaderBase() = default;
SerializedModuleLoader::~SerializedModuleLoader() = default;
Expand Down