mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[modules] Introduce Module::getTopLevelDecls() to get the local-in-module top-level decls.
getDisplayDecls() was introduced for ":print_module" and works slightly differently, e.g. it will return the decls from a shadowed clang module, since we want to display them. Swift SVN r7909
This commit is contained in:
@@ -639,10 +639,7 @@ void ModuleFile::getLinkLibraries(Module::LinkLibraryCallback callback) const {
|
||||
callback(lib);
|
||||
}
|
||||
|
||||
void ModuleFile::getDisplayDecls(SmallVectorImpl<Decl *> &results) {
|
||||
if (ShadowedModule)
|
||||
ShadowedModule->getDisplayDecls(results);
|
||||
|
||||
void ModuleFile::getTopLevelDecls(SmallVectorImpl<Decl *> &results) {
|
||||
if (OperatorDecls) {
|
||||
for (auto entry : make_range(OperatorDecls->data_begin(),
|
||||
OperatorDecls->data_end())) {
|
||||
@@ -667,3 +664,10 @@ void ModuleFile::getDisplayDecls(SmallVectorImpl<Decl *> &results) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ModuleFile::getDisplayDecls(SmallVectorImpl<Decl *> &results) {
|
||||
if (ShadowedModule)
|
||||
ShadowedModule->getDisplayDecls(results);
|
||||
|
||||
getTopLevelDecls(results);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user