Merge pull request #62251 from nkcsgexi/allowable-serialization

serialization: encode allowable client names in binary module format
This commit is contained in:
Xi Ge
2022-11-28 18:12:43 -08:00
committed by GitHub
19 changed files with 115 additions and 2 deletions

View File

@@ -418,7 +418,19 @@ public:
return UserModuleVersion;
}
void addAllowableClientName(Identifier name) {
allowableClientNames.push_back(name);
}
ArrayRef<Identifier> getAllowableClientNames() const {
return allowableClientNames;
}
bool allowImportedBy(ModuleDecl *importer) const;
private:
/// An array of module names that are allowed to import this one.
/// Any module can import this one if empty.
std::vector<Identifier> allowableClientNames;
/// A cache of this module's underlying module and required bystander if it's
/// an underscored cross-import overlay.
Optional<std::pair<ModuleDecl *, Identifier>> declaringModuleAndBystander;