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
877
877
// / Returns the associated clang module if one exists.
878
878
const clang::Module *findUnderlyingClangModule () const ;
879
879
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
+
880
884
// / Returns a generator with the components of this module's full,
881
885
// / hierarchical name.
882
886
// /
Original file line number Diff line number Diff line change @@ -2175,6 +2175,14 @@ const clang::Module *ModuleDecl::findUnderlyingClangModule() const {
2175
2175
return nullptr ;
2176
2176
}
2177
2177
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
+
2178
2186
void ModuleDecl::collectBasicSourceFileInfo (
2179
2187
llvm::function_ref<void (const BasicSourceFileInfo &)> callback) const {
2180
2188
for (const FileUnit *fileUnit : getFiles ()) {
You can’t perform that action at this time.
0 commit comments