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

@@ -1923,6 +1923,18 @@ Identifier ModuleDecl::getRealName() const {
return getASTContext().getRealModuleName(getName());
}
bool ModuleDecl::allowImportedBy(ModuleDecl *importer) const {
if (allowableClientNames.empty())
return true;
for (auto id: allowableClientNames) {
if (importer->getRealName() == id)
return true;
if (importer->getABIName() == id)
return true;
}
return false;
}
Identifier ModuleDecl::getABIName() const {
if (!ModuleABIName.empty())
return ModuleABIName;