diff --git a/include/swift/AST/ASTContext.h b/include/swift/AST/ASTContext.h index a43f36df646..050449e66f3 100644 --- a/include/swift/AST/ASTContext.h +++ b/include/swift/AST/ASTContext.h @@ -183,9 +183,6 @@ public: /// This state should be tracked somewhere else. unsigned LastCheckedExternalDefinition = 0; - /// \brief The list of externally-created types that need validation. - std::vector ExternalTypes; - private: /// \brief The current generation number, which reflects the number of /// times that external modules have been loaded. @@ -336,10 +333,6 @@ public: /// was just added. void addedExternalDecl(Decl *decl); - /// \brief Notify all of the mutation listeners that the given type - /// was just added. - void addedExternalType(Type type); - /// Add a cleanup function to be called when the ASTContext is deallocated. void addCleanup(std::function cleanup); diff --git a/include/swift/AST/ASTMutationListener.h b/include/swift/AST/ASTMutationListener.h index f856bb6fb5b..ae9b3af3cb7 100644 --- a/include/swift/AST/ASTMutationListener.h +++ b/include/swift/AST/ASTMutationListener.h @@ -27,9 +27,6 @@ namespace swift { /// \brief A new declaration was added to the AST. virtual void addedExternalDecl(Decl *decl) = 0; - - /// \brief A new type was added to the AST. - virtual void addedExternalType(Type type) = 0; }; } diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index ab38f47da32..c78f66b85b5 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -541,11 +541,6 @@ void ASTContext::addedExternalDecl(Decl *decl) { listener->addedExternalDecl(decl); } -void ASTContext::addedExternalType(Type type) { - for (auto listener : Impl.MutationListeners) - listener->addedExternalType(type); -} - void ASTContext::addCleanup(std::function cleanup) { Impl.Cleanups.push_back(std::move(cleanup)); } diff --git a/lib/ClangImporter/ImportType.cpp b/lib/ClangImporter/ImportType.cpp index f0b85a4780a..6bd05afa602 100644 --- a/lib/ClangImporter/ImportType.cpp +++ b/lib/ClangImporter/ImportType.cpp @@ -560,10 +560,7 @@ Type ClangImporter::Implementation::importType(clang::QualType type, } SwiftTypeConverter converter(*this, kind); - Type converted = converter.Visit(type.getTypePtr()); - if (converted) - SwiftContext.addedExternalType(converted); - return converted; + return converter.Visit(type.getTypePtr()); } /// Given the first selector piece for an init method, e.g., \c initWithFoo, diff --git a/lib/Sema/NameBinding.cpp b/lib/Sema/NameBinding.cpp index 2983ab58857..2e4942315e8 100644 --- a/lib/Sema/NameBinding.cpp +++ b/lib/Sema/NameBinding.cpp @@ -332,11 +332,6 @@ namespace { virtual void addedExternalDecl(Decl *decl) { TU->getASTContext().ExternalDefinitions.insert(decl); } - - /// \brief A new type was added to the AST. - virtual void addedExternalType(Type type) { - TU->getASTContext().ExternalTypes.push_back(type); - } }; } diff --git a/lib/Sema/TypeChecker.cpp b/lib/Sema/TypeChecker.cpp index 632c5f006e5..c52f136e617 100644 --- a/lib/Sema/TypeChecker.cpp +++ b/lib/Sema/TypeChecker.cpp @@ -62,10 +62,6 @@ void TypeChecker::addedExternalDecl(Decl *decl) { Context.ExternalDefinitions.insert(decl); } -void TypeChecker::addedExternalType(Type type) { - Context.ExternalTypes.push_back(type); -} - ProtocolDecl *TypeChecker::getProtocol(SourceLoc loc, KnownProtocolKind kind) { auto protocol = Context.getProtocol(kind); if (!protocol && loc.isValid()) { diff --git a/lib/Sema/TypeChecker.h b/lib/Sema/TypeChecker.h index 09ce46c9a80..5c3f47ec505 100644 --- a/lib/Sema/TypeChecker.h +++ b/lib/Sema/TypeChecker.h @@ -705,10 +705,6 @@ public: /// \brief A new declaration was added to the AST. virtual void addedExternalDecl(Decl *decl); - - /// \brief A new type was added to the AST. - virtual void addedExternalType(Type type); - /// @} /// \name Lazy resolution.