Skip to content

Commit f6cab92

Browse files
remove the now-unneeded shouldCollectDisplayDecls method
1 parent f0a94ef commit f6cab92

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
@@ -1092,15 +1092,6 @@ class ModuleDecl
10921092
/// The order of the results is not guaranteed to be meaningful.
10931093
void getPrecedenceGroups(SmallVectorImpl<PrecedenceGroupDecl*> &Results) const;
10941094

1095-
/// Determines whether this module should be recursed into when calling
1096-
/// \c getDisplayDecls.
1097-
///
1098-
/// Some modules should not call \c getDisplayDecls, due to assertions
1099-
/// in their implementation. These are usually implicit imports that would be
1100-
/// recursed into for parsed modules. This function provides a guard against
1101-
/// recusing into modules that should not have decls collected.
1102-
bool shouldCollectDisplayDecls() const;
1103-
11041095
/// Finds all top-level decls that should be displayed to a client of this
11051096
/// module.
11061097
///

include/swift/ClangImporter/ClangModule.h

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

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

9795
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
@@ -1234,14 +1234,6 @@ void SourceFile::lookupObjCMethods(
12341234
results.append(known->second.begin(), known->second.end());
12351235
}
12361236

1237-
bool ModuleDecl::shouldCollectDisplayDecls() const {
1238-
for (const FileUnit *file : getFiles()) {
1239-
if (!file->shouldCollectDisplayDecls())
1240-
return false;
1241-
}
1242-
return true;
1243-
}
1244-
12451237
void ModuleDecl::getLocalTypeDecls(SmallVectorImpl<TypeDecl*> &Results) const {
12461238
FORWARD(getLocalTypeDecls, (Results));
12471239
}
@@ -1466,9 +1458,6 @@ void ModuleDecl::ImportCollector::collect(
14661458
const ImportedModule &importedModule) {
14671459
auto *module = importedModule.importedModule;
14681460

1469-
if (!module->shouldCollectDisplayDecls())
1470-
return;
1471-
14721461
if (importFilter && !importFilter(module))
14731462
return;
14741463

lib/ClangImporter/ClangImporter.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3619,8 +3619,6 @@ class VectorDeclPtrConsumer : public swift::VisibleDeclConsumer {
36193619
};
36203620
} // unnamed namespace
36213621

3622-
bool ClangModuleUnit::shouldCollectDisplayDecls() const { return true; }
3623-
36243622
void ClangModuleUnit::getTopLevelDecls(SmallVectorImpl<Decl*> &results) const {
36253623
VectorDeclPtrConsumer consumer(results);
36263624
FilteringDeclaredDeclConsumer filterConsumer(consumer, this);

0 commit comments

Comments
 (0)