@@ -780,22 +780,6 @@ void SourceFile::lookupObjCMethods(
780
780
results.append (known->second .begin (), known->second .end ());
781
781
}
782
782
783
- static void collectParsedExportedImports (const ModuleDecl *M, SmallPtrSetImpl<ModuleDecl *> &Imports) {
784
- for (const FileUnit *file : M->getFiles ()) {
785
- if (const SourceFile *source = dyn_cast<SourceFile>(file)) {
786
- if (source->hasImports ()) {
787
- for (auto import : source->getImports ()) {
788
- if (import .options .contains (ImportFlags::Exported)) {
789
- if (!Imports.contains (import .module .importedModule )) {
790
- Imports.insert (import .module .importedModule );
791
- }
792
- }
793
- }
794
- }
795
- }
796
- }
797
- }
798
-
799
783
void ModuleDecl::getLocalTypeDecls (SmallVectorImpl<TypeDecl*> &Results) const {
800
784
FORWARD (getLocalTypeDecls, (Results));
801
785
}
@@ -804,24 +788,6 @@ void ModuleDecl::getTopLevelDecls(SmallVectorImpl<Decl*> &Results) const {
804
788
FORWARD (getTopLevelDecls, (Results));
805
789
}
806
790
807
- void ModuleDecl::dumpDisplayDecls () const {
808
- SmallVector<Decl *, 32 > Decls;
809
- getDisplayDecls (Decls);
810
- for (auto *D : Decls) {
811
- D->dump (llvm::errs ());
812
- llvm::errs () << " \n " ;
813
- }
814
- }
815
-
816
- void ModuleDecl::dumpTopLevelDecls () const {
817
- SmallVector<Decl *, 32 > Decls;
818
- getTopLevelDecls (Decls);
819
- for (auto *D : Decls) {
820
- D->dump (llvm::errs ());
821
- llvm::errs () << " \n " ;
822
- }
823
- }
824
-
825
791
void ModuleDecl::getExportedPrespecializations (
826
792
SmallVectorImpl<Decl *> &Results) const {
827
793
FORWARD (getExportedPrespecializations, (Results));
@@ -942,23 +908,8 @@ SourceFile::getExternalRawLocsForDecl(const Decl *D) const {
942
908
}
943
909
944
910
void ModuleDecl::getDisplayDecls (SmallVectorImpl<Decl*> &Results) const {
945
- if (isParsedModule (this )) {
946
- SmallPtrSet<ModuleDecl *, 4 > Modules;
947
- collectParsedExportedImports (this , Modules);
948
- for (const ModuleDecl *import : Modules) {
949
- import ->getDisplayDecls (Results);
950
- }
951
- }
952
911
// FIXME: Should this do extra access control filtering?
953
912
FORWARD (getDisplayDecls, (Results));
954
-
955
- #ifndef NDEBUG
956
- llvm::DenseSet<Decl *> visited;
957
- for (auto *D : Results) {
958
- auto inserted = visited.insert (D).second ;
959
- assert (inserted && " there should be no duplicate decls" );
960
- }
961
- #endif
962
913
}
963
914
964
915
ProtocolConformanceRef
@@ -3115,22 +3066,6 @@ void FileUnit::getTopLevelDeclsWhereAttributesMatch(
3115
3066
Results.erase (newEnd, Results.end ());
3116
3067
}
3117
3068
3118
- void FileUnit::dumpDisplayDecls () const {
3119
- SmallVector<Decl *, 32 > Decls;
3120
- getDisplayDecls (Decls);
3121
- for (auto *D : Decls) {
3122
- D->dump (llvm::errs ());
3123
- }
3124
- }
3125
-
3126
- void FileUnit::dumpTopLevelDecls () const {
3127
- SmallVector<Decl *, 32 > Decls;
3128
- getTopLevelDecls (Decls);
3129
- for (auto *D : Decls) {
3130
- D->dump (llvm::errs ());
3131
- }
3132
- }
3133
-
3134
3069
void swift::simple_display (llvm::raw_ostream &out, const FileUnit *file) {
3135
3070
if (!file) {
3136
3071
out << " (null)" ;
0 commit comments