File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -877,6 +877,10 @@ class ModuleDecl
877877 // / Returns the associated clang module if one exists.
878878 const clang::Module *findUnderlyingClangModule () const ;
879879
880+ // / Does this module or the underlying clang module defines export_as with
881+ // / a value corresponding to the \p other module?
882+ bool isExportedAs (const ModuleDecl *other) const ;
883+
880884 // / Returns a generator with the components of this module's full,
881885 // / hierarchical name.
882886 // /
Original file line number Diff line number Diff line change @@ -2175,6 +2175,14 @@ const clang::Module *ModuleDecl::findUnderlyingClangModule() const {
21752175 return nullptr ;
21762176}
21772177
2178+ bool ModuleDecl::isExportedAs (const ModuleDecl *other) const {
2179+ auto clangModule = findUnderlyingClangModule ();
2180+ if (!clangModule)
2181+ return false ;
2182+
2183+ return other->getRealName ().str () == clangModule->ExportAsModule ;
2184+ }
2185+
21782186void ModuleDecl::collectBasicSourceFileInfo (
21792187 llvm::function_ref<void (const BasicSourceFileInfo &)> callback) const {
21802188 for (const FileUnit *fileUnit : getFiles ()) {
You can’t perform that action at this time.
0 commit comments