@@ -145,17 +145,14 @@ class UnqualifiedLookupFactory {
145
145
146
146
private:
147
147
struct PlacesToSearch {
148
- // / The context in which the places were found.
149
- DeclContext *const fromWhence;
150
148
// / Nontypes are formally members of the base type
151
149
DeclContext *const whereNonTypesAreMembers;
152
150
// / Types are formally members of the metatype
153
151
DeclContext *const whereTypesAreMembers;
154
152
// / Places to search for the lookup.
155
153
SmallVector<NominalTypeDecl *, 2 > places;
156
154
157
- PlacesToSearch (DeclContext *fromWhence,
158
- DeclContext *whereNonTypesAreMembers,
155
+ PlacesToSearch (DeclContext *whereNonTypesAreMembers,
159
156
DeclContext *whereTypesAreMembers,
160
157
DeclContext *placesHolder);
161
158
bool empty () const {
@@ -757,7 +754,7 @@ UnqualifiedLookupFactory::lookupInPatternBindingInitializer(
757
754
return PerDeclInfo{
758
755
false ,
759
756
parent,
760
- PlacesToSearch (parent, PBI, parent, parent),
757
+ PlacesToSearch (PBI, parent, parent),
761
758
resolveIsCascadingUse (PBI, isCascadingUse,
762
759
/* onlyCareAboutFunctionBody=*/ false )};
763
760
// clang-format no
@@ -770,7 +767,7 @@ UnqualifiedLookupFactory::lookupInPatternBindingInitializer(
770
767
return PerDeclInfo{
771
768
false ,
772
769
surroundingContext,
773
- PlacesToSearch (surroundingContext, surroundingContext,
770
+ PlacesToSearch (surroundingContext,
774
771
surroundingContext, surroundingContext),
775
772
resolveIsCascadingUse (surroundingContext,
776
773
None,
@@ -842,13 +839,11 @@ UnqualifiedLookupFactory::lookupInFunctionDecl(AbstractFunctionDecl *AFD,
842
839
// performing name lookup from there), the base declaration
843
840
// is the nominal type, not 'self'.
844
841
DeclContext *const BaseDC = isOutsideBodyOfFunction (AFD) ? fnDeclContext : AFD;
845
- DeclContext *const fnParent = AFD->getParent ();
846
842
// clang-format off
847
843
return PerDeclInfo{
848
844
false ,
849
- fnParent,
850
- PlacesToSearch (fnParent,
851
- BaseDC,
845
+ AFD->getParent (),
846
+ PlacesToSearch (BaseDC,
852
847
fnDeclContext,
853
848
fnDeclContext),
854
849
returnValueForIsCascadingUse};
@@ -894,7 +889,7 @@ UnqualifiedLookupFactory::lookupInNominalTypeOrExtension(
894
889
false ,
895
890
D,
896
891
shouldLookupMembers (D, Loc)
897
- ? Optional<PlacesToSearch>(PlacesToSearch (D, D, D, D ))
892
+ ? Optional<PlacesToSearch>(PlacesToSearch (D, D, D))
898
893
: None,
899
894
resolveIsCascadingUse (D, isCascadingUse,
900
895
/* onlyCareAboutFunctionBody=*/ false )};
@@ -1710,16 +1705,14 @@ TypeDecl *LegacyUnqualifiedLookup::getSingleTypeResult() const {
1710
1705
}
1711
1706
1712
1707
UnqualifiedLookupFactory::PlacesToSearch::PlacesToSearch (
1713
- DeclContext *fromWhence, DeclContext * whereNonTypesAreMembers,
1708
+ DeclContext *whereNonTypesAreMembers,
1714
1709
DeclContext *whereTypesAreMembers, DeclContext *placesHolder)
1715
- : fromWhence(fromWhence), whereNonTypesAreMembers(whereNonTypesAreMembers),
1710
+ : whereNonTypesAreMembers(whereNonTypesAreMembers),
1716
1711
whereTypesAreMembers(whereTypesAreMembers) {
1717
1712
populateLookupDeclsFromContext (placesHolder, places);
1718
1713
}
1719
1714
1720
1715
void UnqualifiedLookupFactory::PlacesToSearch::dump () const {
1721
- llvm::errs () << " fromWhence: " ;
1722
- fromWhence->dumpContext ();
1723
1716
llvm::errs () << " whereNonTypesAreMembers: " ;
1724
1717
whereNonTypesAreMembers->dumpContext ();
1725
1718
llvm::errs () << " whereTypesAreMembers: " ;
0 commit comments