diff --git a/include/swift/AST/ASTScope.h b/include/swift/AST/ASTScope.h index 8d38c5409f7d3..7572ee5b14c34 100644 --- a/include/swift/AST/ASTScope.h +++ b/include/swift/AST/ASTScope.h @@ -986,18 +986,11 @@ class AbstractFunctionBodyScope : public ASTScopeImpl { public: AbstractFunctionDecl *const decl; - /// \c Parser::parseAbstractFunctionBodyDelayed can call \c - /// AbstractFunctionDecl::setBody after the tree has been constructed. So if - /// this changes, have to rebuild body. - NullablePtr bodyWhenLastExpanded; - AbstractFunctionBodyScope(AbstractFunctionDecl *e) : decl(e) {} virtual ~AbstractFunctionBodyScope() {} protected: ASTScopeImpl *expandSpecifically(ScopeCreator &scopeCreator) override; - void beCurrent() override; - bool isCurrentIfWasExpanded() const override; private: void expandAScopeThatDoesNotCreateANewInsertionPoint(ScopeCreator &); diff --git a/lib/AST/ASTScopeCreation.cpp b/lib/AST/ASTScopeCreation.cpp index b67d94a8c2bc7..63a0cec4029e0 100644 --- a/lib/AST/ASTScopeCreation.cpp +++ b/lib/AST/ASTScopeCreation.cpp @@ -1695,14 +1695,6 @@ bool ASTSourceFileScope::isCurrentIfWasExpanded() const { return SF->getTopLevelDecls().size() == numberOfDeclsAlreadySeen; } -void AbstractFunctionBodyScope::beCurrent() { - bodyWhenLastExpanded = decl->getBody(false); -} -bool AbstractFunctionBodyScope::isCurrentIfWasExpanded() const { - // Pass in false to keep the compiler from synthesizing one. - return bodyWhenLastExpanded == decl->getBody(false); -} - // Try to avoid the work of counting static const bool assumeVarsDoNotGetAdded = true;