@@ -280,7 +280,6 @@ class ASTScopeImpl {
280
280
public:
281
281
virtual NullablePtr<ClosureExpr> getClosureIfClosureScope () const ;
282
282
virtual ASTContext &getASTContext () const ;
283
- virtual NullablePtr<DeclContext> getDeclContext () const ;
284
283
virtual NullablePtr<Decl> getDeclIfAny () const { return nullptr ; };
285
284
virtual NullablePtr<Stmt> getStmtIfAny () const { return nullptr ; };
286
285
virtual NullablePtr<Expr> getExprIfAny () const { return nullptr ; };
@@ -486,8 +485,6 @@ class ASTSourceFileScope final : public ASTScopeImpl {
486
485
void printSpecifics (llvm::raw_ostream &out) const override ;
487
486
488
487
public:
489
- NullablePtr<DeclContext> getDeclContext () const override ;
490
-
491
488
void buildFullyExpandedTree ();
492
489
void
493
490
buildEnoughOfTreeForTopLevelExpressionsButDontRequestGenericsOrExtendedNominals ();
@@ -497,6 +494,8 @@ class ASTSourceFileScope final : public ASTScopeImpl {
497
494
const SourceFile *getSourceFile () const override ;
498
495
NullablePtr<const void > addressForPrinting () const override { return SF; }
499
496
497
+ ASTContext &getASTContext () const override ;
498
+
500
499
protected:
501
500
ASTScopeImpl *expandSpecifically (ScopeCreator &scopeCreator) override ;
502
501
@@ -682,7 +681,6 @@ class GenericTypeOrExtensionScope : public ASTScopeImpl {
682
681
// Returns the where clause scope, or the parent if none
683
682
virtual ASTScopeImpl *createTrailingWhereClauseScope (ASTScopeImpl *parent,
684
683
ScopeCreator &);
685
- NullablePtr<DeclContext> getDeclContext () const override ;
686
684
virtual NullablePtr<NominalTypeDecl> getCorrespondingNominalTypeDecl () const {
687
685
return nullptr ;
688
686
}
@@ -827,7 +825,6 @@ class GenericParamScope final : public ASTScopeImpl {
827
825
828
826
// / Actually holder is always a GenericContext, need to test if
829
827
// / ProtocolDecl or SubscriptDecl but will refactor later.
830
- NullablePtr<DeclContext> getDeclContext () const override ;
831
828
NullablePtr<const void > getReferrent () const override ;
832
829
std::string getClassName () const override ;
833
830
SourceRange
@@ -868,8 +865,6 @@ class AbstractFunctionDeclScope final : public ASTScopeImpl {
868
865
void printSpecifics (llvm::raw_ostream &out) const override ;
869
866
870
867
public:
871
- virtual NullablePtr<DeclContext> getDeclContext () const override ;
872
-
873
868
virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
874
869
Decl *getDecl () const { return decl; }
875
870
@@ -904,7 +899,6 @@ class ParameterListScope final : public ASTScopeImpl {
904
899
std::string getClassName () const override ;
905
900
SourceRange
906
901
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
907
- virtual NullablePtr<DeclContext> getDeclContext () const override ;
908
902
909
903
NullablePtr<const void > addressForPrinting () const override { return params; }
910
904
};
@@ -927,9 +921,6 @@ class FunctionBodyScope : public ASTScopeImpl {
927
921
public:
928
922
SourceRange
929
923
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
930
- virtual NullablePtr<DeclContext> getDeclContext () const override {
931
- return decl;
932
- }
933
924
virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
934
925
Decl *getDecl () const { return decl; }
935
926
@@ -957,7 +948,6 @@ class DefaultArgumentInitializerScope final : public ASTScopeImpl {
957
948
std::string getClassName () const override ;
958
949
SourceRange
959
950
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
960
- virtual NullablePtr<DeclContext> getDeclContext () const override ;
961
951
virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
962
952
Decl *getDecl () const { return decl; }
963
953
};
@@ -1000,7 +990,6 @@ class AttachedPropertyWrapperScope final : public ASTScopeImpl {
1000
990
SourceRange
1001
991
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1002
992
NullablePtr<const void > addressForPrinting () const override { return decl; }
1003
- virtual NullablePtr<DeclContext> getDeclContext () const override ;
1004
993
1005
994
NullablePtr<DeclAttribute> getDeclAttributeIfAny () const override {
1006
995
return attr;
@@ -1099,7 +1088,6 @@ class PatternEntryInitializerScope final : public AbstractPatternEntryScope {
1099
1088
std::string getClassName () const override ;
1100
1089
SourceRange
1101
1090
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1102
- virtual NullablePtr<DeclContext> getDeclContext () const override ;
1103
1091
1104
1092
protected:
1105
1093
bool lookupLocalsOrMembers (DeclConsumer) const override ;
@@ -1187,7 +1175,6 @@ class CaptureListScope final : public ASTScopeImpl {
1187
1175
std::string getClassName () const override ;
1188
1176
SourceRange
1189
1177
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1190
- NullablePtr<DeclContext> getDeclContext () const override ;
1191
1178
NullablePtr<Expr> getExprIfAny () const override { return expr; }
1192
1179
Expr *getExpr () const { return expr; }
1193
1180
NullablePtr<const void > getReferrent () const override ;
@@ -1210,9 +1197,6 @@ class ClosureParametersScope final : public ASTScopeImpl {
1210
1197
NullablePtr<ClosureExpr> getClosureIfClosureScope () const override {
1211
1198
return closureExpr;
1212
1199
}
1213
- NullablePtr<DeclContext> getDeclContext () const override {
1214
- return closureExpr;
1215
- }
1216
1200
NullablePtr<Expr> getExprIfAny () const override { return closureExpr; }
1217
1201
Expr *getExpr () const { return closureExpr; }
1218
1202
NullablePtr<const void > getReferrent () const override ;
@@ -1245,9 +1229,6 @@ class TopLevelCodeScope final : public ASTScopeImpl {
1245
1229
std::string getClassName () const override ;
1246
1230
SourceRange
1247
1231
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1248
- virtual NullablePtr<DeclContext> getDeclContext () const override {
1249
- return decl;
1250
- }
1251
1232
virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
1252
1233
Decl *getDecl () const { return decl; }
1253
1234
NullablePtr<const void > getReferrent () const override ;
@@ -1334,9 +1315,6 @@ class SubscriptDeclScope final : public ASTScopeImpl {
1334
1315
void printSpecifics (llvm::raw_ostream &out) const override ;
1335
1316
1336
1317
public:
1337
- virtual NullablePtr<DeclContext> getDeclContext () const override {
1338
- return decl;
1339
- }
1340
1318
virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
1341
1319
Decl *getDecl () const { return decl; }
1342
1320
NullablePtr<const void > getReferrent () const override ;
@@ -1356,7 +1334,6 @@ class EnumElementScope : public ASTScopeImpl {
1356
1334
1357
1335
std::string getClassName () const override ;
1358
1336
ASTScopeImpl *expandSpecifically (ScopeCreator &) override ;
1359
- NullablePtr<DeclContext> getDeclContext () const override { return decl; }
1360
1337
NullablePtr<Decl> getDeclIfAny () const override { return decl; }
1361
1338
Decl *getDecl () const { return decl; }
1362
1339
@@ -1698,7 +1675,6 @@ class BraceStmtScope final : public AbstractStmtScope {
1698
1675
std::string getClassName () const override ;
1699
1676
SourceRange
1700
1677
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1701
- virtual NullablePtr<DeclContext> getDeclContext () const override ;
1702
1678
1703
1679
NullablePtr<ClosureExpr> parentClosureIfAny () const ; // public??
1704
1680
Stmt *getStmt () const override { return stmt; }
0 commit comments