diff --git a/include/swift/AST/FileUnit.h b/include/swift/AST/FileUnit.h index 51cc26bd8e4f4..0417ea846368c 100644 --- a/include/swift/AST/FileUnit.h +++ b/include/swift/AST/FileUnit.h @@ -16,7 +16,6 @@ #include "swift/AST/Module.h" #include "swift/AST/RawComment.h" #include "swift/Basic/BasicSourceInfo.h" -#include "swift/Basic/Debug.h" #include "llvm/ADT/PointerIntPair.h" @@ -309,9 +308,6 @@ class FileUnit : public DeclContext, public ASTAllocated { return getParentModule()->getRealName().str(); } - SWIFT_DEBUG_DUMPER(dumpDisplayDecls()); - SWIFT_DEBUG_DUMPER(dumpTopLevelDecls()); - /// Traverse the decls within this file. /// /// \returns true if traversal was aborted, false if it completed diff --git a/include/swift/AST/Module.h b/include/swift/AST/Module.h index 18b985bc372ee..46ed457ba8bce 100644 --- a/include/swift/AST/Module.h +++ b/include/swift/AST/Module.h @@ -26,7 +26,6 @@ #include "swift/AST/Type.h" #include "swift/Basic/BasicSourceInfo.h" #include "swift/Basic/Compiler.h" -#include "swift/Basic/Debug.h" #include "swift/Basic/OptionSet.h" #include "swift/Basic/STLExtras.h" #include "swift/Basic/SourceLoc.h" @@ -857,9 +856,6 @@ class ModuleDecl /// transferred from module files to the dSYMs, remove this. bool isExternallyConsumed() const; - SWIFT_DEBUG_DUMPER(dumpDisplayDecls()); - SWIFT_DEBUG_DUMPER(dumpTopLevelDecls()); - SourceRange getSourceRange() const { return SourceRange(); } static bool classof(const DeclContext *DC) { diff --git a/include/swift/AST/SourceFile.h b/include/swift/AST/SourceFile.h index 9b7d221a60c45..99136c7051dba 100644 --- a/include/swift/AST/SourceFile.h +++ b/include/swift/AST/SourceFile.h @@ -288,10 +288,6 @@ class SourceFile final : public FileUnit { ~SourceFile(); - bool hasImports() const { - return Imports.hasValue(); - } - /// Retrieve an immutable view of the source file's imports. ArrayRef> getImports() const { return *Imports; diff --git a/lib/AST/Module.cpp b/lib/AST/Module.cpp index 07274fee10894..fd9ed704cdca5 100644 --- a/lib/AST/Module.cpp +++ b/lib/AST/Module.cpp @@ -780,22 +780,6 @@ void SourceFile::lookupObjCMethods( results.append(known->second.begin(), known->second.end()); } -static void collectParsedExportedImports(const ModuleDecl *M, SmallPtrSetImpl &Imports) { - for (const FileUnit *file : M->getFiles()) { - if (const SourceFile *source = dyn_cast(file)) { - if (source->hasImports()) { - for (auto import : source->getImports()) { - if (import.options.contains(ImportFlags::Exported)) { - if (!Imports.contains(import.module.importedModule)) { - Imports.insert(import.module.importedModule); - } - } - } - } - } - } -} - void ModuleDecl::getLocalTypeDecls(SmallVectorImpl &Results) const { FORWARD(getLocalTypeDecls, (Results)); } @@ -804,24 +788,6 @@ void ModuleDecl::getTopLevelDecls(SmallVectorImpl &Results) const { FORWARD(getTopLevelDecls, (Results)); } -void ModuleDecl::dumpDisplayDecls() const { - SmallVector Decls; - getDisplayDecls(Decls); - for (auto *D : Decls) { - D->dump(llvm::errs()); - llvm::errs() << "\n"; - } -} - -void ModuleDecl::dumpTopLevelDecls() const { - SmallVector Decls; - getTopLevelDecls(Decls); - for (auto *D : Decls) { - D->dump(llvm::errs()); - llvm::errs() << "\n"; - } -} - void ModuleDecl::getExportedPrespecializations( SmallVectorImpl &Results) const { FORWARD(getExportedPrespecializations, (Results)); @@ -942,23 +908,8 @@ SourceFile::getExternalRawLocsForDecl(const Decl *D) const { } void ModuleDecl::getDisplayDecls(SmallVectorImpl &Results) const { - if (isParsedModule(this)) { - SmallPtrSet Modules; - collectParsedExportedImports(this, Modules); - for (const ModuleDecl *import : Modules) { - import->getDisplayDecls(Results); - } - } // FIXME: Should this do extra access control filtering? FORWARD(getDisplayDecls, (Results)); - -#ifndef NDEBUG - llvm::DenseSet visited; - for (auto *D : Results) { - auto inserted = visited.insert(D).second; - assert(inserted && "there should be no duplicate decls"); - } -#endif } ProtocolConformanceRef @@ -3111,22 +3062,6 @@ void FileUnit::getTopLevelDeclsWhereAttributesMatch( Results.erase(newEnd, Results.end()); } -void FileUnit::dumpDisplayDecls() const { - SmallVector Decls; - getDisplayDecls(Decls); - for (auto *D : Decls) { - D->dump(llvm::errs()); - } -} - -void FileUnit::dumpTopLevelDecls() const { - SmallVector Decls; - getTopLevelDecls(Decls); - for (auto *D : Decls) { - D->dump(llvm::errs()); - } -} - void swift::simple_display(llvm::raw_ostream &out, const FileUnit *file) { if (!file) { out << "(null)"; diff --git a/test/SymbolGraph/ClangImporter/EmitWhileBuilding.swift b/test/SymbolGraph/ClangImporter/EmitWhileBuilding.swift index 7c39f50551537..f44a3bdcf9b62 100644 --- a/test/SymbolGraph/ClangImporter/EmitWhileBuilding.swift +++ b/test/SymbolGraph/ClangImporter/EmitWhileBuilding.swift @@ -1,9 +1,8 @@ // RUN: %empty-directory(%t) // RUN: cp -r %S/Inputs/EmitWhileBuilding/EmitWhileBuilding.framework %t -// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-objc-interop -emit-module-path %t/EmitWhileBuilding.framework/Modules/EmitWhileBuilding.swiftmodule/%target-swiftmodule-name -import-underlying-module -F %t -module-name EmitWhileBuilding -disable-objc-attr-requires-foundation-module %s %S/Inputs/EmitWhileBuilding/Extra.swift -emit-symbol-graph -emit-symbol-graph-dir %t +// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-objc-interop -emit-module-path %t/EmitWhileBuilding.framework/Modules/EmitWhileBuilding.swiftmodule/%target-swiftmodule-name -import-underlying-module -F %t -module-name EmitWhileBuilding -disable-objc-attr-requires-foundation-module %s -emit-symbol-graph -emit-symbol-graph-dir %t // RUN: %{python} -m json.tool %t/EmitWhileBuilding.symbols.json %t/EmitWhileBuilding.formatted.symbols.json // RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.formatted.symbols.json -// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.formatted.symbols.json --check-prefix HEADER // REQUIRES: objc_interop @@ -11,9 +10,6 @@ import Foundation public enum SwiftEnum {} -// HEADER: "precise": "c:@testVariable" - -// CHECK: "precise": "s:17EmitWhileBuilding9SwiftEnumO", // CHECK: "declarationFragments": [ // CHECK-NEXT: { // CHECK-NEXT: "kind": "keyword", diff --git a/test/SymbolGraph/ClangImporter/Inputs/EmitWhileBuilding/Extra.swift b/test/SymbolGraph/ClangImporter/Inputs/EmitWhileBuilding/Extra.swift deleted file mode 100644 index 7a0e59c907c0b..0000000000000 --- a/test/SymbolGraph/ClangImporter/Inputs/EmitWhileBuilding/Extra.swift +++ /dev/null @@ -1 +0,0 @@ -public struct SomeStruct {}