Skip to content

Commit f9812e8

Browse files
committed
ASTScope: PatternBindingEntry scopes are always current
1 parent 5b264d9 commit f9812e8

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

include/swift/AST/ASTScope.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,8 +1144,6 @@ class PatternEntryDeclScope final : public AbstractPatternEntryScope {
11441144

11451145
protected:
11461146
ASTScopeImpl *expandSpecifically(ScopeCreator &scopeCreator) override;
1147-
void beCurrent() override;
1148-
bool isCurrentIfWasExpanded() const override;
11491147

11501148
private:
11511149
AnnotatedInsertionPoint

lib/AST/ASTScopeCreation.cpp

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

1698-
// Try to avoid the work of counting
1699-
static const bool assumeVarsDoNotGetAdded = true;
1700-
1701-
void PatternEntryDeclScope::beCurrent() {
1702-
initWhenLastExpanded = getPatternEntry().getOriginalInit();
1703-
if (assumeVarsDoNotGetAdded && varCountWhenLastExpanded)
1704-
return;
1705-
varCountWhenLastExpanded = getPatternEntry().getNumBoundVariables();
1706-
}
1707-
bool PatternEntryDeclScope::isCurrentIfWasExpanded() const {
1708-
if (initWhenLastExpanded != getPatternEntry().getOriginalInit())
1709-
return false;
1710-
if (assumeVarsDoNotGetAdded && varCountWhenLastExpanded) {
1711-
ASTScopeAssert(varCountWhenLastExpanded ==
1712-
getPatternEntry().getNumBoundVariables(),
1713-
"Vars were not supposed to be added to a pattern entry.");
1714-
return true;
1715-
}
1716-
return getPatternEntry().getNumBoundVariables() == varCountWhenLastExpanded;
1717-
}
1718-
17191698
#pragma mark getParentOfASTAncestorScopesToBeRescued
17201699
NullablePtr<ASTScopeImpl>
17211700
ASTScopeImpl::getParentOfASTAncestorScopesToBeRescued() {

0 commit comments

Comments
 (0)