Skip to content

Commit 7648ece

Browse files
committed
Rm unneeded instvar
1 parent 19b7801 commit 7648ece

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

lib/AST/UnqualifiedLookup.cpp

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,17 +145,14 @@ class UnqualifiedLookupFactory {
145145

146146
private:
147147
struct PlacesToSearch {
148-
/// The context in which the places were found.
149-
DeclContext *const fromWhence;
150148
/// Nontypes are formally members of the base type
151149
DeclContext *const whereNonTypesAreMembers;
152150
/// Types are formally members of the metatype
153151
DeclContext *const whereTypesAreMembers;
154152
/// Places to search for the lookup.
155153
SmallVector<NominalTypeDecl *, 2> places;
156154

157-
PlacesToSearch(DeclContext *fromWhence,
158-
DeclContext *whereNonTypesAreMembers,
155+
PlacesToSearch(DeclContext *whereNonTypesAreMembers,
159156
DeclContext *whereTypesAreMembers,
160157
DeclContext *placesHolder);
161158
bool empty() const {
@@ -757,7 +754,7 @@ UnqualifiedLookupFactory::lookupInPatternBindingInitializer(
757754
return PerDeclInfo{
758755
false,
759756
parent,
760-
PlacesToSearch(parent, PBI, parent, parent),
757+
PlacesToSearch(PBI, parent, parent),
761758
resolveIsCascadingUse(PBI, isCascadingUse,
762759
/*onlyCareAboutFunctionBody=*/false)};
763760
// clang-format no
@@ -770,7 +767,7 @@ UnqualifiedLookupFactory::lookupInPatternBindingInitializer(
770767
return PerDeclInfo{
771768
false,
772769
surroundingContext,
773-
PlacesToSearch(surroundingContext, surroundingContext,
770+
PlacesToSearch(surroundingContext,
774771
surroundingContext, surroundingContext),
775772
resolveIsCascadingUse(surroundingContext,
776773
None,
@@ -842,13 +839,11 @@ UnqualifiedLookupFactory::lookupInFunctionDecl(AbstractFunctionDecl *AFD,
842839
// performing name lookup from there), the base declaration
843840
// is the nominal type, not 'self'.
844841
DeclContext *const BaseDC = isOutsideBodyOfFunction(AFD) ? fnDeclContext : AFD;
845-
DeclContext *const fnParent = AFD->getParent();
846842
// clang-format off
847843
return PerDeclInfo{
848844
false,
849-
fnParent,
850-
PlacesToSearch(fnParent,
851-
BaseDC,
845+
AFD->getParent(),
846+
PlacesToSearch(BaseDC,
852847
fnDeclContext,
853848
fnDeclContext),
854849
returnValueForIsCascadingUse};
@@ -894,7 +889,7 @@ UnqualifiedLookupFactory::lookupInNominalTypeOrExtension(
894889
false,
895890
D,
896891
shouldLookupMembers(D, Loc)
897-
? Optional<PlacesToSearch>(PlacesToSearch(D, D, D, D))
892+
? Optional<PlacesToSearch>(PlacesToSearch(D, D, D))
898893
: None,
899894
resolveIsCascadingUse(D, isCascadingUse,
900895
/*onlyCareAboutFunctionBody=*/false)};
@@ -1710,16 +1705,14 @@ TypeDecl *LegacyUnqualifiedLookup::getSingleTypeResult() const {
17101705
}
17111706

17121707
UnqualifiedLookupFactory::PlacesToSearch::PlacesToSearch(
1713-
DeclContext *fromWhence, DeclContext *whereNonTypesAreMembers,
1708+
DeclContext *whereNonTypesAreMembers,
17141709
DeclContext *whereTypesAreMembers, DeclContext *placesHolder)
1715-
: fromWhence(fromWhence), whereNonTypesAreMembers(whereNonTypesAreMembers),
1710+
: whereNonTypesAreMembers(whereNonTypesAreMembers),
17161711
whereTypesAreMembers(whereTypesAreMembers) {
17171712
populateLookupDeclsFromContext(placesHolder, places);
17181713
}
17191714

17201715
void UnqualifiedLookupFactory::PlacesToSearch::dump() const {
1721-
llvm::errs() << "fromWhence: ";
1722-
fromWhence->dumpContext();
17231716
llvm::errs() << "whereNonTypesAreMembers: ";
17241717
whereNonTypesAreMembers->dumpContext();
17251718
llvm::errs() << "whereTypesAreMembers: ";

0 commit comments

Comments
 (0)