Skip to content

Commit 7c43e10

Browse files
committed
ASTScope: Remove getEnclosingAbstractStorageDecl()
1 parent 3295725 commit 7c43e10

File tree

2 files changed

+0
-50
lines changed

2 files changed

+0
-50
lines changed

include/swift/AST/ASTScope.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,6 @@ class ASTScopeImpl {
345345
virtual SourceRange sourceRangeForDeferredExpansion() const;
346346

347347
public:
348-
virtual NullablePtr<AbstractStorageDecl>
349-
getEnclosingAbstractStorageDecl() const;
350-
351348
bool isATypeDeclScope() const;
352349

353350
private:
@@ -845,9 +842,6 @@ class GenericParamScope final : public ASTScopeImpl {
845842
void printSpecifics(llvm::raw_ostream &out) const override;
846843

847844
public:
848-
NullablePtr<AbstractStorageDecl>
849-
getEnclosingAbstractStorageDecl() const override;
850-
851845
NullablePtr<const void> addressForPrinting() const override {
852846
return paramList;
853847
}
@@ -883,9 +877,6 @@ class AbstractFunctionDeclScope final : public ASTScopeImpl {
883877
virtual NullablePtr<Decl> getDeclIfAny() const override { return decl; }
884878
Decl *getDecl() const { return decl; }
885879

886-
NullablePtr<AbstractStorageDecl>
887-
getEnclosingAbstractStorageDecl() const override;
888-
889880
NullablePtr<const void> getReferrent() const override;
890881

891882
protected:
@@ -919,8 +910,6 @@ class ParameterListScope final : public ASTScopeImpl {
919910
getSourceRangeOfThisASTNode(bool omitAssertions = false) const override;
920911
virtual NullablePtr<DeclContext> getDeclContext() const override;
921912

922-
NullablePtr<AbstractStorageDecl>
923-
getEnclosingAbstractStorageDecl() const override;
924913
NullablePtr<const void> addressForPrinting() const override { return params; }
925914
};
926915

@@ -1285,9 +1274,6 @@ class SpecializeAttributeScope final : public ASTScopeImpl {
12851274
return specializeAttr;
12861275
}
12871276

1288-
NullablePtr<AbstractStorageDecl>
1289-
getEnclosingAbstractStorageDecl() const override;
1290-
12911277
NullablePtr<DeclAttribute> getDeclAttributeIfAny() const override {
12921278
return specializeAttr;
12931279
}
@@ -1318,9 +1304,6 @@ class DifferentiableAttributeScope final : public ASTScopeImpl {
13181304
return differentiableAttr;
13191305
}
13201306

1321-
NullablePtr<AbstractStorageDecl>
1322-
getEnclosingAbstractStorageDecl() const override;
1323-
13241307
NullablePtr<DeclAttribute> getDeclAttributeIfAny() const override {
13251308
return differentiableAttr;
13261309
}
@@ -1362,10 +1345,6 @@ class SubscriptDeclScope final : public ASTScopeImpl {
13621345

13631346
protected:
13641347
NullablePtr<const GenericParamList> genericParams() const override;
1365-
NullablePtr<AbstractStorageDecl>
1366-
getEnclosingAbstractStorageDecl() const override {
1367-
return decl;
1368-
}
13691348
};
13701349

13711350
class EnumElementScope : public ASTScopeImpl {

lib/AST/ASTScopeCreation.cpp

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,35 +1424,6 @@ AbstractPatternEntryScope::AbstractPatternEntryScope(
14241424
"out of bounds");
14251425
}
14261426

1427-
// Following must be after uses to ensure templates get instantiated
1428-
#pragma mark getEnclosingAbstractStorageDecl
1429-
1430-
NullablePtr<AbstractStorageDecl>
1431-
ASTScopeImpl::getEnclosingAbstractStorageDecl() const {
1432-
return nullptr;
1433-
}
1434-
1435-
NullablePtr<AbstractStorageDecl>
1436-
SpecializeAttributeScope::getEnclosingAbstractStorageDecl() const {
1437-
return getParent().get()->getEnclosingAbstractStorageDecl();
1438-
}
1439-
NullablePtr<AbstractStorageDecl>
1440-
DifferentiableAttributeScope::getEnclosingAbstractStorageDecl() const {
1441-
return getParent().get()->getEnclosingAbstractStorageDecl();
1442-
}
1443-
NullablePtr<AbstractStorageDecl>
1444-
AbstractFunctionDeclScope::getEnclosingAbstractStorageDecl() const {
1445-
return getParent().get()->getEnclosingAbstractStorageDecl();
1446-
}
1447-
NullablePtr<AbstractStorageDecl>
1448-
ParameterListScope::getEnclosingAbstractStorageDecl() const {
1449-
return getParent().get()->getEnclosingAbstractStorageDecl();
1450-
}
1451-
NullablePtr<AbstractStorageDecl>
1452-
GenericParamScope::getEnclosingAbstractStorageDecl() const {
1453-
return getParent().get()->getEnclosingAbstractStorageDecl();
1454-
}
1455-
14561427
bool ASTScopeImpl::isATypeDeclScope() const {
14571428
Decl *const pd = getDeclIfAny().getPtrOrNull();
14581429
return pd && (isa<NominalTypeDecl>(pd) || isa<ExtensionDecl>(pd));

0 commit comments

Comments
 (0)