Skip to content

Commit 5b264d9

Browse files
committed
ASTScope: AbstractFunctionBodyScope scopes are always current
1 parent 0e78611 commit 5b264d9

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

include/swift/AST/ASTScope.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -986,18 +986,11 @@ class AbstractFunctionBodyScope : public ASTScopeImpl {
986986
public:
987987
AbstractFunctionDecl *const decl;
988988

989-
/// \c Parser::parseAbstractFunctionBodyDelayed can call \c
990-
/// AbstractFunctionDecl::setBody after the tree has been constructed. So if
991-
/// this changes, have to rebuild body.
992-
NullablePtr<BraceStmt> bodyWhenLastExpanded;
993-
994989
AbstractFunctionBodyScope(AbstractFunctionDecl *e) : decl(e) {}
995990
virtual ~AbstractFunctionBodyScope() {}
996991

997992
protected:
998993
ASTScopeImpl *expandSpecifically(ScopeCreator &scopeCreator) override;
999-
void beCurrent() override;
1000-
bool isCurrentIfWasExpanded() const override;
1001994

1002995
private:
1003996
void expandAScopeThatDoesNotCreateANewInsertionPoint(ScopeCreator &);

lib/AST/ASTScopeCreation.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,14 +1695,6 @@ bool ASTSourceFileScope::isCurrentIfWasExpanded() const {
16951695
return SF->getTopLevelDecls().size() == numberOfDeclsAlreadySeen;
16961696
}
16971697

1698-
void AbstractFunctionBodyScope::beCurrent() {
1699-
bodyWhenLastExpanded = decl->getBody(false);
1700-
}
1701-
bool AbstractFunctionBodyScope::isCurrentIfWasExpanded() const {
1702-
// Pass in false to keep the compiler from synthesizing one.
1703-
return bodyWhenLastExpanded == decl->getBody(false);
1704-
}
1705-
17061698
// Try to avoid the work of counting
17071699
static const bool assumeVarsDoNotGetAdded = true;
17081700

0 commit comments

Comments
 (0)