Skip to content

Commit 8299c83

Browse files
remove the now-unneeded shouldCollectDisplayDecls method
1 parent 8e9c418 commit 8299c83

File tree

5 files changed

+0
-26
lines changed

5 files changed

+0
-26
lines changed

include/swift/AST/FileUnit.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,6 @@ class FileUnit : public DeclContext, public ASTAllocated<FileUnit> {
195195
virtual Identifier
196196
getDiscriminatorForPrivateDecl(const Decl *D) const = 0;
197197

198-
virtual bool shouldCollectDisplayDecls() const { return true; }
199-
200198
/// Finds all top-level decls in this file.
201199
///
202200
/// This does a simple local lookup, not recursively looking through imports.

include/swift/AST/Module.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,15 +1058,6 @@ class ModuleDecl
10581058
/// The order of the results is not guaranteed to be meaningful.
10591059
void getPrecedenceGroups(SmallVectorImpl<PrecedenceGroupDecl*> &Results) const;
10601060

1061-
/// Determines whether this module should be recursed into when calling
1062-
/// \c getDisplayDecls.
1063-
///
1064-
/// Some modules should not call \c getDisplayDecls, due to assertions
1065-
/// in their implementation. These are usually implicit imports that would be
1066-
/// recursed into for parsed modules. This function provides a guard against
1067-
/// recusing into modules that should not have decls collected.
1068-
bool shouldCollectDisplayDecls() const;
1069-
10701061
/// Finds all top-level decls that should be displayed to a client of this
10711062
/// module.
10721063
///

include/swift/ClangImporter/ClangModule.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ class ClangModuleUnit final : public LoadedFile {
8989
ObjCSelector selector,
9090
SmallVectorImpl<AbstractFunctionDecl *> &results) const override;
9191

92-
virtual bool shouldCollectDisplayDecls() const override;
93-
9492
virtual void getTopLevelDecls(SmallVectorImpl<Decl*> &results) const override;
9593

9694
virtual void getDisplayDecls(SmallVectorImpl<Decl*> &results, bool recursive = false) const override;

lib/AST/Module.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,14 +1198,6 @@ void SourceFile::lookupObjCMethods(
11981198
results.append(known->second.begin(), known->second.end());
11991199
}
12001200

1201-
bool ModuleDecl::shouldCollectDisplayDecls() const {
1202-
for (const FileUnit *file : Files) {
1203-
if (!file->shouldCollectDisplayDecls())
1204-
return false;
1205-
}
1206-
return true;
1207-
}
1208-
12091201
void ModuleDecl::getLocalTypeDecls(SmallVectorImpl<TypeDecl*> &Results) const {
12101202
FORWARD(getLocalTypeDecls, (Results));
12111203
}
@@ -1430,9 +1422,6 @@ void ModuleDecl::ImportCollector::collect(
14301422
const ImportedModule &importedModule) {
14311423
auto *module = importedModule.importedModule;
14321424

1433-
if (!module->shouldCollectDisplayDecls())
1434-
return;
1435-
14361425
if (importFilter && !importFilter(module))
14371426
return;
14381427

lib/ClangImporter/ClangImporter.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3585,8 +3585,6 @@ class VectorDeclPtrConsumer : public swift::VisibleDeclConsumer {
35853585
};
35863586
} // unnamed namespace
35873587

3588-
bool ClangModuleUnit::shouldCollectDisplayDecls() const { return true; }
3589-
35903588
void ClangModuleUnit::getTopLevelDecls(SmallVectorImpl<Decl*> &results) const {
35913589
VectorDeclPtrConsumer consumer(results);
35923590
FilteringDeclaredDeclConsumer filterConsumer(consumer, this);

0 commit comments

Comments
 (0)