[AST] Intro a check for the export_as relationship between 2 modules

This commit is contained in:
Alexis Laferrière
2022-11-14 12:28:31 -08:00
parent c0abde01a2
commit e52fbb89c1
2 changed files with 12 additions and 0 deletions

View File

@@ -2175,6 +2175,14 @@ const clang::Module *ModuleDecl::findUnderlyingClangModule() const {
return nullptr;
}
bool ModuleDecl::isExportedAs(const ModuleDecl *other) const {
auto clangModule = findUnderlyingClangModule();
if (!clangModule)
return false;
return other->getRealName().str() == clangModule->ExportAsModule;
}
void ModuleDecl::collectBasicSourceFileInfo(
llvm::function_ref<void(const BasicSourceFileInfo &)> callback) const {
for (const FileUnit *fileUnit : getFiles()) {