add support to getTopLevelDecls for clang submodules (#76401)

rdar://126031510
This commit is contained in:
QuietMisdreavus
2025-01-30 09:39:58 -07:00
committed by GitHub
parent b3275d9db3
commit ab26b8b9d7
23 changed files with 693 additions and 277 deletions

View File

@@ -856,6 +856,12 @@ public:
/// returns the module \c Foo.
ModuleDecl *getTopLevelModule(bool overlay = false);
/// Returns whether or not this module is a submodule of the given module.
/// If `this == M`, this returns false. If this is a submodule such as
/// `Foo.Bar.Baz`, and the given module is either `Foo` or `Foo.Bar`, this
/// returns true.
bool isSubmoduleOf(const ModuleDecl *M) const;
bool isResilient() const {
return getResilienceStrategy() != ResilienceStrategy::Default;
}
@@ -1095,15 +1101,6 @@ public:
/// The order of the results is not guaranteed to be meaningful.
void getPrecedenceGroups(SmallVectorImpl<PrecedenceGroupDecl*> &Results) const;
/// Determines whether this module should be recursed into when calling
/// \c getDisplayDecls.
///
/// Some modules should not call \c getDisplayDecls, due to assertions
/// in their implementation. These are usually implicit imports that would be
/// recursed into for parsed modules. This function provides a guard against
/// recusing into modules that should not have decls collected.
bool shouldCollectDisplayDecls() const;
/// Finds all top-level decls that should be displayed to a client of this
/// module.
///