@@ -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 ; };
@@ -354,7 +353,7 @@ class ASTScopeImpl {
354
353
355
354
// / Entry point into ASTScopeImpl-land for lookups
356
355
static void
357
- unqualifiedLookup (SourceFile *, DeclNameRef, SourceLoc, DeclConsumer);
356
+ unqualifiedLookup (SourceFile *, SourceLoc, DeclConsumer);
358
357
359
358
// / Entry point into ASTScopeImpl-land for labeled statement lookups.
360
359
static llvm::SmallVector<LabeledStmt *, 4 >
@@ -366,7 +365,6 @@ class ASTScopeImpl {
366
365
#pragma mark - - lookup- starting point
367
366
private:
368
367
static const ASTScopeImpl *findStartingScopeForLookup (SourceFile *,
369
- const DeclNameRef name,
370
368
const SourceLoc where);
371
369
372
370
protected:
@@ -487,8 +485,6 @@ class ASTSourceFileScope final : public ASTScopeImpl {
487
485
void printSpecifics (llvm::raw_ostream &out) const override ;
488
486
489
487
public:
490
- NullablePtr<DeclContext> getDeclContext () const override ;
491
-
492
488
void buildFullyExpandedTree ();
493
489
void
494
490
buildEnoughOfTreeForTopLevelExpressionsButDontRequestGenericsOrExtendedNominals ();
@@ -497,7 +493,8 @@ class ASTSourceFileScope final : public ASTScopeImpl {
497
493
498
494
const SourceFile *getSourceFile () const override ;
499
495
NullablePtr<const void > addressForPrinting () const override { return SF; }
500
- bool crossCheckWithAST ();
496
+
497
+ ASTContext &getASTContext () const override ;
501
498
502
499
protected:
503
500
ASTScopeImpl *expandSpecifically (ScopeCreator &scopeCreator) override ;
@@ -684,7 +681,6 @@ class GenericTypeOrExtensionScope : public ASTScopeImpl {
684
681
// Returns the where clause scope, or the parent if none
685
682
virtual ASTScopeImpl *createTrailingWhereClauseScope (ASTScopeImpl *parent,
686
683
ScopeCreator &);
687
- NullablePtr<DeclContext> getDeclContext () const override ;
688
684
virtual NullablePtr<NominalTypeDecl> getCorrespondingNominalTypeDecl () const {
689
685
return nullptr ;
690
686
}
@@ -829,7 +825,6 @@ class GenericParamScope final : public ASTScopeImpl {
829
825
830
826
// / Actually holder is always a GenericContext, need to test if
831
827
// / ProtocolDecl or SubscriptDecl but will refactor later.
832
- NullablePtr<DeclContext> getDeclContext () const override ;
833
828
NullablePtr<const void > getReferrent () const override ;
834
829
std::string getClassName () const override ;
835
830
SourceRange
@@ -870,8 +865,6 @@ class AbstractFunctionDeclScope final : public ASTScopeImpl {
870
865
void printSpecifics (llvm::raw_ostream &out) const override ;
871
866
872
867
public:
873
- virtual NullablePtr<DeclContext> getDeclContext () const override ;
874
-
875
868
virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
876
869
Decl *getDecl () const { return decl; }
877
870
@@ -906,7 +899,6 @@ class ParameterListScope final : public ASTScopeImpl {
906
899
std::string getClassName () const override ;
907
900
SourceRange
908
901
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
909
- virtual NullablePtr<DeclContext> getDeclContext () const override ;
910
902
911
903
NullablePtr<const void > addressForPrinting () const override { return params; }
912
904
};
@@ -929,9 +921,6 @@ class FunctionBodyScope : public ASTScopeImpl {
929
921
public:
930
922
SourceRange
931
923
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
932
- virtual NullablePtr<DeclContext> getDeclContext () const override {
933
- return decl;
934
- }
935
924
virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
936
925
Decl *getDecl () const { return decl; }
937
926
@@ -959,7 +948,6 @@ class DefaultArgumentInitializerScope final : public ASTScopeImpl {
959
948
std::string getClassName () const override ;
960
949
SourceRange
961
950
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
962
- virtual NullablePtr<DeclContext> getDeclContext () const override ;
963
951
virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
964
952
Decl *getDecl () const { return decl; }
965
953
};
@@ -1002,7 +990,6 @@ class AttachedPropertyWrapperScope final : public ASTScopeImpl {
1002
990
SourceRange
1003
991
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1004
992
NullablePtr<const void > addressForPrinting () const override { return decl; }
1005
- virtual NullablePtr<DeclContext> getDeclContext () const override ;
1006
993
1007
994
NullablePtr<DeclAttribute> getDeclAttributeIfAny () const override {
1008
995
return attr;
@@ -1101,7 +1088,6 @@ class PatternEntryInitializerScope final : public AbstractPatternEntryScope {
1101
1088
std::string getClassName () const override ;
1102
1089
SourceRange
1103
1090
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1104
- virtual NullablePtr<DeclContext> getDeclContext () const override ;
1105
1091
1106
1092
protected:
1107
1093
bool lookupLocalsOrMembers (DeclConsumer) const override ;
@@ -1189,7 +1175,6 @@ class CaptureListScope final : public ASTScopeImpl {
1189
1175
std::string getClassName () const override ;
1190
1176
SourceRange
1191
1177
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1192
- NullablePtr<DeclContext> getDeclContext () const override ;
1193
1178
NullablePtr<Expr> getExprIfAny () const override { return expr; }
1194
1179
Expr *getExpr () const { return expr; }
1195
1180
NullablePtr<const void > getReferrent () const override ;
@@ -1212,9 +1197,6 @@ class ClosureParametersScope final : public ASTScopeImpl {
1212
1197
NullablePtr<ClosureExpr> getClosureIfClosureScope () const override {
1213
1198
return closureExpr;
1214
1199
}
1215
- NullablePtr<DeclContext> getDeclContext () const override {
1216
- return closureExpr;
1217
- }
1218
1200
NullablePtr<Expr> getExprIfAny () const override { return closureExpr; }
1219
1201
Expr *getExpr () const { return closureExpr; }
1220
1202
NullablePtr<const void > getReferrent () const override ;
@@ -1247,9 +1229,6 @@ class TopLevelCodeScope final : public ASTScopeImpl {
1247
1229
std::string getClassName () const override ;
1248
1230
SourceRange
1249
1231
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1250
- virtual NullablePtr<DeclContext> getDeclContext () const override {
1251
- return decl;
1252
- }
1253
1232
virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
1254
1233
Decl *getDecl () const { return decl; }
1255
1234
NullablePtr<const void > getReferrent () const override ;
@@ -1336,9 +1315,6 @@ class SubscriptDeclScope final : public ASTScopeImpl {
1336
1315
void printSpecifics (llvm::raw_ostream &out) const override ;
1337
1316
1338
1317
public:
1339
- virtual NullablePtr<DeclContext> getDeclContext () const override {
1340
- return decl;
1341
- }
1342
1318
virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
1343
1319
Decl *getDecl () const { return decl; }
1344
1320
NullablePtr<const void > getReferrent () const override ;
@@ -1358,7 +1334,6 @@ class EnumElementScope : public ASTScopeImpl {
1358
1334
1359
1335
std::string getClassName () const override ;
1360
1336
ASTScopeImpl *expandSpecifically (ScopeCreator &) override ;
1361
- NullablePtr<DeclContext> getDeclContext () const override { return decl; }
1362
1337
NullablePtr<Decl> getDeclIfAny () const override { return decl; }
1363
1338
Decl *getDecl () const { return decl; }
1364
1339
@@ -1700,7 +1675,6 @@ class BraceStmtScope final : public AbstractStmtScope {
1700
1675
std::string getClassName () const override ;
1701
1676
SourceRange
1702
1677
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1703
- virtual NullablePtr<DeclContext> getDeclContext () const override ;
1704
1678
1705
1679
NullablePtr<ClosureExpr> parentClosureIfAny () const ; // public??
1706
1680
Stmt *getStmt () const override { return stmt; }
0 commit comments