@@ -194,10 +194,6 @@ class ASTScopeImpl {
194
194
#pragma mark - source ranges
195
195
196
196
public:
197
- // / Return signum of ranges. Centralize the invariant that ASTScopes use ends.
198
- static int compare (SourceRange, SourceRange, const SourceManager &,
199
- bool ensureDisjoint);
200
-
201
197
CharSourceRange getCharSourceRangeOfScope (SourceManager &SM,
202
198
bool omitAssertions = false ) const ;
203
199
bool isCharSourceRangeCached () const ;
@@ -224,7 +220,6 @@ class ASTScopeImpl {
224
220
virtual NullablePtr<DeclAttribute> getDeclAttributeIfAny () const {
225
221
return nullptr ;
226
222
}
227
- virtual NullablePtr<const void > getReferrent () const { return nullptr ; }
228
223
229
224
#pragma mark - debugging and printing
230
225
@@ -402,7 +397,6 @@ class ASTSourceFileScope final : public ASTScopeImpl {
402
397
public:
403
398
SourceFile *const SF;
404
399
ScopeCreator *const scopeCreator;
405
- ASTScopeImpl *insertionPoint;
406
400
407
401
ASTSourceFileScope (SourceFile *SF, ScopeCreator *scopeCreator);
408
402
@@ -470,9 +464,6 @@ class Portion {
470
464
virtual NullablePtr<const ASTScopeImpl>
471
465
getLookupLimitFor (const GenericTypeOrExtensionScope *) const ;
472
466
473
- virtual const Decl *
474
- getReferrentOfScope (const GenericTypeOrExtensionScope *s) const ;
475
-
476
467
virtual NullablePtr<ASTScopeImpl>
477
468
insertionPointForDeferredExpansion (IterableTypeScope *) const = 0 ;
478
469
};
@@ -493,9 +484,6 @@ class Portion {
493
484
NullablePtr<const ASTScopeImpl>
494
485
getLookupLimitFor (const GenericTypeOrExtensionScope *) const override ;
495
486
496
- const Decl *
497
- getReferrentOfScope (const GenericTypeOrExtensionScope *s) const override ;
498
-
499
487
NullablePtr<ASTScopeImpl>
500
488
insertionPointForDeferredExpansion (IterableTypeScope *) const override ;
501
489
};
@@ -570,7 +558,6 @@ class GenericTypeOrExtensionScope : public ASTScopeImpl {
570
558
571
559
virtual Decl *getDecl () const = 0;
572
560
NullablePtr<Decl> getDeclIfAny () const override { return getDecl (); }
573
- NullablePtr<const void > getReferrent () const override ;
574
561
575
562
private:
576
563
AnnotatedInsertionPoint
@@ -745,7 +732,6 @@ class GenericParamScope final : public ASTScopeImpl {
745
732
746
733
// / Actually holder is always a GenericContext, need to test if
747
734
// / ProtocolDecl or SubscriptDecl but will refactor later.
748
- NullablePtr<const void > getReferrent () const override ;
749
735
std::string getClassName () const override ;
750
736
SourceRange
751
737
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
@@ -788,8 +774,6 @@ class AbstractFunctionDeclScope final : public ASTScopeImpl {
788
774
virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
789
775
Decl *getDecl () const { return decl; }
790
776
791
- NullablePtr<const void > getReferrent () const override ;
792
-
793
777
protected:
794
778
NullablePtr<const GenericParamList> genericParams () const override ;
795
779
};
@@ -813,7 +797,6 @@ class ParameterListScope final : public ASTScopeImpl {
813
797
814
798
private:
815
799
void expandAScopeThatDoesNotCreateANewInsertionPoint (ScopeCreator &);
816
- SourceLoc fixupEndForBadInput (SourceRange) const ;
817
800
818
801
public:
819
802
std::string getClassName () const override ;
@@ -902,7 +885,6 @@ class AttachedPropertyWrapperScope final : public ASTScopeImpl {
902
885
NullablePtr<DeclAttribute> getDeclAttributeIfAny () const override {
903
886
return attr;
904
887
}
905
- NullablePtr<const void > getReferrent () const override ;
906
888
907
889
private:
908
890
void expandAScopeThatDoesNotCreateANewInsertionPoint (ScopeCreator &);
@@ -970,8 +952,6 @@ class PatternEntryDeclScope final : public AbstractPatternEntryScope {
970
952
SourceRange
971
953
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
972
954
973
- NullablePtr<const void > getReferrent () const override ;
974
-
975
955
protected:
976
956
bool lookupLocalsOrMembers (DeclConsumer) const override ;
977
957
bool isLabeledStmtLookupTerminator () const override ;
@@ -1072,7 +1052,6 @@ class CaptureListScope final : public ASTScopeImpl {
1072
1052
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1073
1053
NullablePtr<Expr> getExprIfAny () const override { return expr; }
1074
1054
Expr *getExpr () const { return expr; }
1075
- NullablePtr<const void > getReferrent () const override ;
1076
1055
bool lookupLocalsOrMembers (DeclConsumer) const override ;
1077
1056
};
1078
1057
@@ -1094,7 +1073,6 @@ class ClosureParametersScope final : public ASTScopeImpl {
1094
1073
}
1095
1074
NullablePtr<Expr> getExprIfAny () const override { return closureExpr; }
1096
1075
Expr *getExpr () const { return closureExpr; }
1097
- NullablePtr<const void > getReferrent () const override ;
1098
1076
1099
1077
protected:
1100
1078
ASTScopeImpl *expandSpecifically (ScopeCreator &scopeCreator) override ;
@@ -1128,7 +1106,6 @@ class TopLevelCodeScope final : public ASTScopeImpl {
1128
1106
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1129
1107
virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
1130
1108
Decl *getDecl () const { return decl; }
1131
- NullablePtr<const void > getReferrent () const override ;
1132
1109
};
1133
1110
1134
1111
// / The \c _@specialize attribute.
@@ -1153,7 +1130,6 @@ class SpecializeAttributeScope final : public ASTScopeImpl {
1153
1130
NullablePtr<DeclAttribute> getDeclAttributeIfAny () const override {
1154
1131
return specializeAttr;
1155
1132
}
1156
- NullablePtr<const void > getReferrent () const override ;
1157
1133
1158
1134
protected:
1159
1135
ASTScopeImpl *expandSpecifically (ScopeCreator &) override ;
@@ -1183,7 +1159,6 @@ class DifferentiableAttributeScope final : public ASTScopeImpl {
1183
1159
NullablePtr<DeclAttribute> getDeclAttributeIfAny () const override {
1184
1160
return differentiableAttr;
1185
1161
}
1186
- NullablePtr<const void > getReferrent () const override ;
1187
1162
1188
1163
protected:
1189
1164
ASTScopeImpl *expandSpecifically (ScopeCreator &) override ;
@@ -1214,7 +1189,6 @@ class SubscriptDeclScope final : public ASTScopeImpl {
1214
1189
public:
1215
1190
virtual NullablePtr<Decl> getDeclIfAny () const override { return decl; }
1216
1191
Decl *getDecl () const { return decl; }
1217
- NullablePtr<const void > getReferrent () const override ;
1218
1192
1219
1193
protected:
1220
1194
NullablePtr<const GenericParamList> genericParams () const override ;
@@ -1244,7 +1218,6 @@ class AbstractStmtScope : public ASTScopeImpl {
1244
1218
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1245
1219
virtual Stmt *getStmt () const = 0;
1246
1220
NullablePtr<Stmt> getStmtIfAny () const override { return getStmt (); }
1247
- NullablePtr<const void > getReferrent () const override ;
1248
1221
1249
1222
protected:
1250
1223
bool isLabeledStmtLookupTerminator () const override ;
@@ -1559,11 +1532,11 @@ class BraceStmtScope final : public AbstractStmtScope {
1559
1532
BraceStmt *const stmt;
1560
1533
1561
1534
// / Declarations which are in scope from the beginning of the statement.
1562
- SmallVector <ValueDecl *, 2 > localFuncsAndTypes;
1535
+ ArrayRef <ValueDecl *> localFuncsAndTypes;
1563
1536
1564
1537
// / Declarations that are normally in scope only after their
1565
1538
// / definition.
1566
- SmallVector <VarDecl *, 2 > localVars;
1539
+ ArrayRef <VarDecl *> localVars;
1567
1540
1568
1541
// / The end location for bindings introduced in this scope. This can
1569
1542
// / extend past the actual end of the BraceStmt in top-level code,
@@ -1573,8 +1546,8 @@ class BraceStmtScope final : public AbstractStmtScope {
1573
1546
1574
1547
public:
1575
1548
BraceStmtScope (BraceStmt *e,
1576
- SmallVector <ValueDecl *, 2 > localFuncsAndTypes,
1577
- SmallVector <VarDecl *, 2 > localVars,
1549
+ ArrayRef <ValueDecl *> localFuncsAndTypes,
1550
+ ArrayRef <VarDecl *> localVars,
1578
1551
SourceLoc endLoc)
1579
1552
: stmt(e),
1580
1553
localFuncsAndTypes (localFuncsAndTypes),
0 commit comments