@@ -407,7 +407,7 @@ class ASTScopeImpl {
407
407
using DeclConsumer = namelookup::AbstractASTScopeDeclConsumer &;
408
408
409
409
// / Entry point into ASTScopeImpl-land for lookups
410
- static llvm::SmallVector< const ASTScopeImpl *, 0 >
410
+ static void
411
411
unqualifiedLookup (SourceFile *, DeclNameRef, SourceLoc, DeclConsumer);
412
412
413
413
// / Entry point into ASTScopeImpl-land for labeled statement lookups.
@@ -457,22 +457,17 @@ class ASTScopeImpl {
457
457
// / duplicating work.
458
458
// /
459
459
// / Look in this scope.
460
- // / \param history are the scopes traversed for this lookup (including this
461
- // / 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
462
461
// / getLookupLimit. \param lastListSearched Last list searched.
463
462
// / \param consumer is the object to which found decls are reported.
464
- void lookup (llvm::SmallVectorImpl<const ASTScopeImpl *> &history,
465
- NullablePtr<const ASTScopeImpl> limit,
463
+ void lookup (NullablePtr<const ASTScopeImpl> limit,
466
464
NullablePtr<const GenericParamList> lastListSearched,
467
465
DeclConsumer consumer) const ;
468
466
469
467
protected:
470
468
// / Find either locals or members (no scope has both)
471
- // / \param history The scopes visited since the start of lookup (including
472
- // / this one)
473
469
// / \return True if lookup is done
474
- virtual bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *> history,
475
- DeclConsumer consumer) const ;
470
+ virtual bool lookupLocalsOrMembers (DeclConsumer consumer) const ;
476
471
477
472
// / Returns isDone and the list searched, if any
478
473
std::pair<bool , NullablePtr<const GenericParamList>>
@@ -606,7 +601,6 @@ class Portion {
606
601
bool omitAssertions) const = 0 ;
607
602
608
603
virtual bool lookupMembersOf (const GenericTypeOrExtensionScope *scope,
609
- ArrayRef<const ASTScopeImpl *>,
610
604
ASTScopeImpl::DeclConsumer consumer) const ;
611
605
612
606
virtual NullablePtr<const ASTScopeImpl>
@@ -668,7 +662,6 @@ class Portion {
668
662
virtual ~GenericTypeOrExtensionWhereOrBodyPortion () {}
669
663
670
664
bool lookupMembersOf (const GenericTypeOrExtensionScope *scope,
671
- ArrayRef<const ASTScopeImpl *>,
672
665
ASTScopeImpl::DeclConsumer consumer) const override ;
673
666
};
674
667
@@ -681,7 +674,6 @@ class GenericTypeOrExtensionWherePortion final
681
674
: GenericTypeOrExtensionWhereOrBodyPortion(" Where" ) {}
682
675
683
676
bool lookupMembersOf (const GenericTypeOrExtensionScope *scope,
684
- ArrayRef<const ASTScopeImpl *>,
685
677
ASTScopeImpl::DeclConsumer consumer) const override ;
686
678
687
679
ASTScopeImpl *expandScope (GenericTypeOrExtensionScope *,
@@ -785,8 +777,7 @@ class GenericTypeOrExtensionScope : public ASTScopeImpl {
785
777
786
778
protected:
787
779
bool
788
- lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *> history,
789
- ASTScopeImpl::DeclConsumer consumer) const override ;
780
+ lookupLocalsOrMembers (ASTScopeImpl::DeclConsumer consumer) const override ;
790
781
void printSpecifics (llvm::raw_ostream &out) const override ;
791
782
792
783
public:
@@ -952,8 +943,7 @@ class GenericParamScope final : public ASTScopeImpl {
952
943
}
953
944
954
945
protected:
955
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
956
- DeclConsumer) const override ;
946
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
957
947
};
958
948
959
949
// / Concrete class for a function/initializer/deinitializer
@@ -1058,8 +1048,7 @@ class AbstractFunctionBodyScope : public ASTScopeImpl {
1058
1048
NullablePtr<ASTScopeImpl> getParentOfASTAncestorScopesToBeRescued () override ;
1059
1049
1060
1050
protected:
1061
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1062
- DeclConsumer) const override ;
1051
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1063
1052
1064
1053
public:
1065
1054
NullablePtr<ASTScopeImpl> insertionPointForDeferredExpansion () override ;
@@ -1072,8 +1061,7 @@ class FunctionBodyScope final : public AbstractFunctionBodyScope {
1072
1061
FunctionBodyScope (AbstractFunctionDecl *e)
1073
1062
: AbstractFunctionBodyScope(e) {}
1074
1063
std::string getClassName () const override ;
1075
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1076
- DeclConsumer consumer) const override ;
1064
+ bool lookupLocalsOrMembers (DeclConsumer consumer) const override ;
1077
1065
};
1078
1066
1079
1067
class DefaultArgumentInitializerScope final : public ASTScopeImpl {
@@ -1211,8 +1199,7 @@ class PatternEntryDeclScope final : public AbstractPatternEntryScope {
1211
1199
NullablePtr<const void > getReferrent () const override ;
1212
1200
1213
1201
protected:
1214
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1215
- DeclConsumer) const override ;
1202
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1216
1203
};
1217
1204
1218
1205
class PatternEntryInitializerScope final : public AbstractPatternEntryScope {
@@ -1239,8 +1226,7 @@ class PatternEntryInitializerScope final : public AbstractPatternEntryScope {
1239
1226
virtual NullablePtr<DeclContext> getDeclContext () const override ;
1240
1227
1241
1228
protected:
1242
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1243
- DeclConsumer) const override ;
1229
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1244
1230
};
1245
1231
1246
1232
// / The scope introduced by a conditional clause in an if/guard/while
@@ -1302,8 +1288,7 @@ class ConditionalClausePatternUseScope final : public ASTScopeImpl {
1302
1288
1303
1289
protected:
1304
1290
ASTScopeImpl *expandSpecifically (ScopeCreator &) override ;
1305
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1306
- DeclConsumer) const override ;
1291
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1307
1292
void printSpecifics (llvm::raw_ostream &out) const override ;
1308
1293
bool isLabeledStmtLookupTerminator () const override ;
1309
1294
};
@@ -1330,8 +1315,7 @@ class CaptureListScope final : public ASTScopeImpl {
1330
1315
NullablePtr<Expr> getExprIfAny () const override { return expr; }
1331
1316
Expr *getExpr () const { return expr; }
1332
1317
NullablePtr<const void > getReferrent () const override ;
1333
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1334
- DeclConsumer) const override ;
1318
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1335
1319
};
1336
1320
1337
1321
// / For a closure with named parameters, this scope does the local bindings.
@@ -1364,8 +1348,7 @@ class ClosureParametersScope final : public ASTScopeImpl {
1364
1348
void expandAScopeThatDoesNotCreateANewInsertionPoint (ScopeCreator &);
1365
1349
1366
1350
protected:
1367
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1368
- DeclConsumer) const override ;
1351
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1369
1352
};
1370
1353
1371
1354
class TopLevelCodeScope final : public ASTScopeImpl {
@@ -1429,8 +1412,7 @@ class SpecializeAttributeScope final : public ASTScopeImpl {
1429
1412
1430
1413
protected:
1431
1414
ASTScopeImpl *expandSpecifically (ScopeCreator &) override ;
1432
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1433
- DeclConsumer) const override ;
1415
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1434
1416
};
1435
1417
1436
1418
// / A `@differentiable` attribute scope.
@@ -1463,8 +1445,7 @@ class DifferentiableAttributeScope final : public ASTScopeImpl {
1463
1445
1464
1446
protected:
1465
1447
ASTScopeImpl *expandSpecifically (ScopeCreator &) override ;
1466
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1467
- DeclConsumer) const override ;
1448
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1468
1449
};
1469
1450
1470
1451
class SubscriptDeclScope final : public ASTScopeImpl {
@@ -1763,8 +1744,7 @@ class ForEachPatternScope final : public ASTScopeImpl {
1763
1744
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1764
1745
1765
1746
protected:
1766
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1767
- DeclConsumer) const override ;
1747
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1768
1748
bool isLabeledStmtLookupTerminator () const override ;
1769
1749
};
1770
1750
@@ -1842,8 +1822,7 @@ class CaseLabelItemScope final : public ASTScopeImpl {
1842
1822
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1843
1823
1844
1824
protected:
1845
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1846
- ASTScopeImpl::DeclConsumer) const override ;
1825
+ bool lookupLocalsOrMembers (ASTScopeImpl::DeclConsumer) const override ;
1847
1826
};
1848
1827
1849
1828
// / The scope used for the body of a 'case' statement.
@@ -1871,8 +1850,7 @@ class CaseStmtBodyScope final : public ASTScopeImpl {
1871
1850
SourceRange
1872
1851
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1873
1852
protected:
1874
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1875
- ASTScopeImpl::DeclConsumer) const override ;
1853
+ bool lookupLocalsOrMembers (ASTScopeImpl::DeclConsumer) const override ;
1876
1854
bool isLabeledStmtLookupTerminator () const override ;
1877
1855
};
1878
1856
@@ -1900,8 +1878,7 @@ class BraceStmtScope final : public AbstractStmtScope {
1900
1878
Stmt *getStmt () const override { return stmt; }
1901
1879
1902
1880
protected:
1903
- bool lookupLocalsOrMembers (ArrayRef<const ASTScopeImpl *>,
1904
- DeclConsumer) const override ;
1881
+ bool lookupLocalsOrMembers (DeclConsumer) const override ;
1905
1882
};
1906
1883
} // namespace ast_scope
1907
1884
} // namespace swift
0 commit comments