Skip to content

Commit 0e78611

Browse files
committed
ASTScope: TopLevelCodeDecl scopes are always current
1 parent 7d50b98 commit 0e78611

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

include/swift/AST/ASTScope.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,20 +1321,16 @@ class ClosureParametersScope final : public ASTScopeImpl {
13211321
class TopLevelCodeScope final : public ASTScopeImpl {
13221322
public:
13231323
TopLevelCodeDecl *const decl;
1324-
BraceStmt *bodyWhenLastExpanded;
13251324

13261325
TopLevelCodeScope(TopLevelCodeDecl *e) : decl(e) {}
13271326
virtual ~TopLevelCodeScope() {}
13281327

13291328
protected:
13301329
ASTScopeImpl *expandSpecifically(ScopeCreator &scopeCreator) override;
1331-
void beCurrent() override;
1332-
bool isCurrentIfWasExpanded() const override;
13331330

13341331
private:
13351332
AnnotatedInsertionPoint
13361333
expandAScopeThatCreatesANewInsertionPoint(ScopeCreator &);
1337-
std::vector<ASTScopeImpl *> rescueBodyScopesToReuse();
13381334

13391335
public:
13401336
std::string getClassName() const override;

lib/AST/ASTScopeCreation.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,11 +1703,6 @@ bool AbstractFunctionBodyScope::isCurrentIfWasExpanded() const {
17031703
return bodyWhenLastExpanded == decl->getBody(false);
17041704
}
17051705

1706-
void TopLevelCodeScope::beCurrent() { bodyWhenLastExpanded = decl->getBody(); }
1707-
bool TopLevelCodeScope::isCurrentIfWasExpanded() const {
1708-
return bodyWhenLastExpanded == decl->getBody();
1709-
}
1710-
17111706
// Try to avoid the work of counting
17121707
static const bool assumeVarsDoNotGetAdded = true;
17131708

0 commit comments

Comments
 (0)