@@ -298,9 +298,6 @@ class ASTScopeImpl {
298
298
bool verifyThatChildrenAreContainedWithin (SourceRange) const ;
299
299
bool verifyThatThisNodeComeAfterItsPriorSibling () const ;
300
300
301
- virtual SourceRange
302
- getSourceRangeOfEnclosedParamsOfASTNode (bool omitAssertions) const ;
303
-
304
301
private:
305
302
bool checkSourceRangeAfterExpansion (const ASTContext &) const ;
306
303
@@ -410,7 +407,7 @@ class ASTScopeImpl {
410
407
using DeclConsumer = namelookup::AbstractASTScopeDeclConsumer &;
411
408
412
409
// / Entry point into ASTScopeImpl-land for lookups
413
- static llvm::SmallVector< const ASTScopeImpl *, 0 >
410
+ static void
414
411
unqualifiedLookup (SourceFile *, DeclNameRef, SourceLoc, DeclConsumer);
415
412
416
413
// / Entry point into ASTScopeImpl-land for labeled statement lookups.
@@ -460,22 +457,17 @@ class ASTScopeImpl {
460
457
// / duplicating work.
461
458
// /
462
459
// / Look in this scope.
463
- // / \param history are the scopes traversed for this lookup (including this
464
- // / one) \param limit A scope into which lookup should not go. See \c
460
+ // / \param limit A scope into which lookup should not go. See \c
465
461
// / getLookupLimit. \param lastListSearched Last list searched.
466
462
// / \param consumer is the object to which found decls are reported.
467
- void lookup (llvm::SmallVectorImpl<const ASTScopeImpl *> &history,
468
- NullablePtr<const ASTScopeImpl> limit,
463
+ void lookup (NullablePtr<const ASTScopeImpl> limit,
469
464
NullablePtr<const GenericParamList> lastListSearched,
470
465
DeclConsumer consumer) const ;
471
466
472
467
protected:
473
468
// / Find either locals or members (no scope has both)
474
- // / \param history The scopes visited since the start of lookup (including
475
- // / this one)
476
469
// / \return True if lookup is done
477
- virtual bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *> history,
478
- DeclConsumer consumer) const ;
470
+ virtual bool lookupLocalsOrMembers (DeclConsumer consumer) const ;
479
471
480
472
// / Returns isDone and the list searched, if any
481
473
std::pair<bool , NullablePtr<const GenericParamList>>
@@ -609,7 +601,6 @@ class Portion {
609
601
bool omitAssertions) const = 0 ;
610
602
611
603
virtual bool lookupMembersOf (const GenericTypeOrExtensionScope *scope,
612
- ArrayRef<const ASTScopeImpl *>,
613
604
ASTScopeImpl::DeclConsumer consumer) const ;
614
605
615
606
virtual NullablePtr<const ASTScopeImpl>
@@ -671,7 +662,6 @@ class Portion {
671
662
virtual ~GenericTypeOrExtensionWhereOrBodyPortion () {}
672
663
673
664
bool lookupMembersOf (const GenericTypeOrExtensionScope *scope,
674
- ArrayRef<const ASTScopeImpl *>,
675
665
ASTScopeImpl::DeclConsumer consumer) const override ;
676
666
};
677
667
@@ -684,7 +674,6 @@ class GenericTypeOrExtensionWherePortion final
684
674
: GenericTypeOrExtensionWhereOrBodyPortion(" Where" ) {}
685
675
686
676
bool lookupMembersOf (const GenericTypeOrExtensionScope *scope,
687
- ArrayRef<const ASTScopeImpl *>,
688
677
ASTScopeImpl::DeclConsumer consumer) const override ;
689
678
690
679
ASTScopeImpl *expandScope (GenericTypeOrExtensionScope *,
@@ -788,8 +777,7 @@ class GenericTypeOrExtensionScope : public ASTScopeImpl {
788
777
789
778
protected:
790
779
bool
791
- lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *> history,
792
- ASTScopeImpl::DeclConsumer consumer) const override ;
780
+ lookupLocalsOrMembers (ASTScopeImpl::DeclConsumer consumer) const override ;
793
781
void printSpecifics (llvm::raw_ostream &out) const override ;
794
782
795
783
public:
@@ -955,8 +943,7 @@ class GenericParamScope final : public ASTScopeImpl {
955
943
}
956
944
957
945
protected:
958
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
959
- DeclConsumer) const override ;
946
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
960
947
};
961
948
962
949
// / Concrete class for a function/initializer/deinitializer
@@ -991,13 +978,6 @@ class AbstractFunctionDeclScope final : public ASTScopeImpl {
991
978
992
979
NullablePtr<const void > getReferrent () const override ;
993
980
994
- protected:
995
- SourceRange
996
- getSourceRangeOfEnclosedParamsOfASTNode (bool omitAssertions) const override ;
997
-
998
- private:
999
- static SourceLoc getParmsSourceLocOfAFD (AbstractFunctionDecl *);
1000
-
1001
981
protected:
1002
982
NullablePtr<const GenericParamList> genericParams () const override ;
1003
983
};
@@ -1068,8 +1048,7 @@ class AbstractFunctionBodyScope : public ASTScopeImpl {
1068
1048
NullablePtr<ASTScopeImpl> getParentOfASTAncestorScopesToBeRescued () override ;
1069
1049
1070
1050
protected:
1071
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1072
- DeclConsumer) const override ;
1051
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1073
1052
1074
1053
public:
1075
1054
NullablePtr<ASTScopeImpl> insertionPointForDeferredExpansion () override ;
@@ -1082,8 +1061,7 @@ class FunctionBodyScope final : public AbstractFunctionBodyScope {
1082
1061
FunctionBodyScope (AbstractFunctionDecl *e)
1083
1062
: AbstractFunctionBodyScope(e) {}
1084
1063
std::string getClassName () const override ;
1085
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1086
- DeclConsumer consumer) const override ;
1064
+ bool lookupLocalsOrMembers (DeclConsumer consumer) const override ;
1087
1065
};
1088
1066
1089
1067
class DefaultArgumentInitializerScope final : public ASTScopeImpl {
@@ -1221,8 +1199,7 @@ class PatternEntryDeclScope final : public AbstractPatternEntryScope {
1221
1199
NullablePtr<const void > getReferrent () const override ;
1222
1200
1223
1201
protected:
1224
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1225
- DeclConsumer) const override ;
1202
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1226
1203
};
1227
1204
1228
1205
class PatternEntryInitializerScope final : public AbstractPatternEntryScope {
@@ -1249,8 +1226,7 @@ class PatternEntryInitializerScope final : public AbstractPatternEntryScope {
1249
1226
virtual NullablePtr<DeclContext> getDeclContext () const override ;
1250
1227
1251
1228
protected:
1252
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1253
- DeclConsumer) const override ;
1229
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1254
1230
};
1255
1231
1256
1232
// / The scope introduced by a conditional clause in an if/guard/while
@@ -1312,8 +1288,7 @@ class ConditionalClausePatternUseScope final : public ASTScopeImpl {
1312
1288
1313
1289
protected:
1314
1290
ASTScopeImpl *expandSpecifically (ScopeCreator &) override ;
1315
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1316
- DeclConsumer) const override ;
1291
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1317
1292
void printSpecifics (llvm::raw_ostream &out) const override ;
1318
1293
bool isLabeledStmtLookupTerminator () const override ;
1319
1294
};
@@ -1340,8 +1315,7 @@ class CaptureListScope final : public ASTScopeImpl {
1340
1315
NullablePtr<Expr> getExprIfAny () const override { return expr; }
1341
1316
Expr *getExpr () const { return expr; }
1342
1317
NullablePtr<const void > getReferrent () const override ;
1343
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1344
- DeclConsumer) const override ;
1318
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1345
1319
};
1346
1320
1347
1321
// / For a closure with named parameters, this scope does the local bindings.
@@ -1374,8 +1348,7 @@ class ClosureParametersScope final : public ASTScopeImpl {
1374
1348
void expandAScopeThatDoesNotCreateANewInsertionPoint (ScopeCreator &);
1375
1349
1376
1350
protected:
1377
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1378
- DeclConsumer) const override ;
1351
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1379
1352
};
1380
1353
1381
1354
class TopLevelCodeScope final : public ASTScopeImpl {
@@ -1439,8 +1412,7 @@ class SpecializeAttributeScope final : public ASTScopeImpl {
1439
1412
1440
1413
protected:
1441
1414
ASTScopeImpl *expandSpecifically (ScopeCreator &) override ;
1442
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1443
- DeclConsumer) const override ;
1415
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1444
1416
};
1445
1417
1446
1418
// / A `@differentiable` attribute scope.
@@ -1473,8 +1445,7 @@ class DifferentiableAttributeScope final : public ASTScopeImpl {
1473
1445
1474
1446
protected:
1475
1447
ASTScopeImpl *expandSpecifically (ScopeCreator &) override ;
1476
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1477
- DeclConsumer) const override ;
1448
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1478
1449
};
1479
1450
1480
1451
class SubscriptDeclScope final : public ASTScopeImpl {
@@ -1507,9 +1478,6 @@ class SubscriptDeclScope final : public ASTScopeImpl {
1507
1478
NullablePtr<const void > getReferrent () const override ;
1508
1479
1509
1480
protected:
1510
- SourceRange
1511
- getSourceRangeOfEnclosedParamsOfASTNode (bool omitAssertions) const override ;
1512
-
1513
1481
NullablePtr<const GenericParamList> genericParams () const override ;
1514
1482
NullablePtr<AbstractStorageDecl>
1515
1483
getEnclosingAbstractStorageDecl () const override {
@@ -1566,10 +1534,6 @@ class EnumElementScope : public ASTScopeImpl {
1566
1534
NullablePtr<Decl> getDeclIfAny () const override { return decl; }
1567
1535
Decl *getDecl () const { return decl; }
1568
1536
1569
- protected:
1570
- SourceRange
1571
- getSourceRangeOfEnclosedParamsOfASTNode (bool omitAssertions) const override ;
1572
-
1573
1537
private:
1574
1538
void expandAScopeThatDoesNotCreateANewInsertionPoint (ScopeCreator &);
1575
1539
};
@@ -1780,8 +1744,7 @@ class ForEachPatternScope final : public ASTScopeImpl {
1780
1744
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1781
1745
1782
1746
protected:
1783
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1784
- DeclConsumer) const override ;
1747
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1785
1748
bool isLabeledStmtLookupTerminator () const override ;
1786
1749
};
1787
1750
@@ -1859,8 +1822,7 @@ class CaseLabelItemScope final : public ASTScopeImpl {
1859
1822
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1860
1823
1861
1824
protected:
1862
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1863
- ASTScopeImpl::DeclConsumer) const override ;
1825
+ bool lookupLocalsOrMembers (ASTScopeImpl::DeclConsumer) const override ;
1864
1826
};
1865
1827
1866
1828
// / The scope used for the body of a 'case' statement.
@@ -1888,8 +1850,7 @@ class CaseStmtBodyScope final : public ASTScopeImpl {
1888
1850
SourceRange
1889
1851
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1890
1852
protected:
1891
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1892
- ASTScopeImpl::DeclConsumer) const override ;
1853
+ bool lookupLocalsOrMembers (ASTScopeImpl::DeclConsumer) const override ;
1893
1854
bool isLabeledStmtLookupTerminator () const override ;
1894
1855
};
1895
1856
@@ -1917,8 +1878,7 @@ class BraceStmtScope final : public AbstractStmtScope {
1917
1878
Stmt *getStmt () const override { return stmt; }
1918
1879
1919
1880
protected:
1920
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1921
- DeclConsumer) const override ;
1881
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1922
1882
};
1923
1883
} // namespace ast_scope
1924
1884
} // namespace swift
0 commit comments