Skip to content

Commit 1391c3f

Browse files
committed
Rm a flag.
1 parent 7648ece commit 1391c3f

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

lib/AST/UnqualifiedLookup.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ class UnqualifiedLookupFactory {
171171
};
172172

173173
struct PerDeclInfo {
174-
bool isDoneWithThisDecl;
175174
DeclContext *lookupContextForThisDecl;
176175
Optional<PlacesToSearch> placesToSearch;
177176
Optional<bool> isCascadingUse;
@@ -692,17 +691,13 @@ UnqualifiedLookupFactory::lookupInOneDeclContext(
692691
const auto r = lookupInAppropriateContext(dc, isCascadingUseArg);
693692
if (!r.hasValue())
694693
return None;
695-
const bool isDoneWithThisDecl = r.getValue().isDoneWithThisDecl;
696694
breadcrumbs.push_back(r.getValue());
697695
auto lookupContextForThisDecl = r.getValue().lookupContextForThisDecl;
698696
auto placesToSearch = std::move(r.getValue().placesToSearch);
699697
auto isCascadingUse = r.getValue().isCascadingUse;
700698

701-
if (isDoneWithThisDecl)
702-
return LookupInOneDeclContextResult{lookupContextForThisDecl,
703-
isCascadingUse};
704-
705-
if (addGenericParametersHereAndInEnclosingScopes(lookupContextForThisDecl))
699+
if (!dyn_cast<DefaultArgumentInitializer>(dc) &&
700+
addGenericParametersHereAndInEnclosingScopes(lookupContextForThisDecl))
706701
return None;
707702
if (placesToSearch.hasValue() && !placesToSearch.getValue().empty()) {
708703
auto startIndexOfInnerResults = Results.size();
@@ -752,7 +747,6 @@ UnqualifiedLookupFactory::lookupInPatternBindingInitializer(
752747
DeclContext *const parent = PBI->getParent();
753748
// clang-format off
754749
return PerDeclInfo{
755-
false,
756750
parent,
757751
PlacesToSearch(PBI, parent, parent),
758752
resolveIsCascadingUse(PBI, isCascadingUse,
@@ -765,7 +759,6 @@ UnqualifiedLookupFactory::lookupInPatternBindingInitializer(
765759
DeclContext *const surroundingContext = PBI->getParent();
766760
// clang-format off
767761
return PerDeclInfo{
768-
false,
769762
surroundingContext,
770763
PlacesToSearch(surroundingContext,
771764
surroundingContext, surroundingContext),
@@ -779,7 +772,6 @@ UnqualifiedLookupFactory::lookupInPatternBindingInitializer(
779772
// context.
780773
// clang-format off
781774
return PerDeclInfo{
782-
false,
783775
PBI,
784776
None,
785777
resolveIsCascadingUse(PBI, isCascadingUse,
@@ -827,7 +819,6 @@ UnqualifiedLookupFactory::lookupInFunctionDecl(AbstractFunctionDecl *AFD,
827819
if (!AFD->getDeclContext()->isTypeContext())
828820
// clang-format off
829821
return PerDeclInfo{
830-
false,
831822
AFD,
832823
None,
833824
returnValueForIsCascadingUse};
@@ -841,7 +832,6 @@ UnqualifiedLookupFactory::lookupInFunctionDecl(AbstractFunctionDecl *AFD,
841832
DeclContext *const BaseDC = isOutsideBodyOfFunction(AFD) ? fnDeclContext : AFD;
842833
// clang-format off
843834
return PerDeclInfo{
844-
false,
845835
AFD->getParent(),
846836
PlacesToSearch(BaseDC,
847837
fnDeclContext,
@@ -872,7 +862,6 @@ UnqualifiedLookupFactory::lookupInClosure(AbstractClosureExpr *ACE,
872862
}
873863
// clang-format off
874864
return PerDeclInfo{
875-
false,
876865
ACE,
877866
None,
878867
resolveIsCascadingUse(ACE, isCascadingUse,
@@ -886,7 +875,6 @@ UnqualifiedLookupFactory::lookupInNominalTypeOrExtension(
886875
NominalTypeDeclOrExtensionDecl *D, Optional<bool> isCascadingUse) const {
887876
// clang-format off
888877
return PerDeclInfo{
889-
false,
890878
D,
891879
shouldLookupMembers(D, Loc)
892880
? Optional<PlacesToSearch>(PlacesToSearch(D, D, D))
@@ -904,7 +892,6 @@ UnqualifiedLookupFactory::lookupInDefaultArgumentInitializer(
904892
// initializer and the function.
905893
// clang-format off
906894
return PerDeclInfo{
907-
true,
908895
I->getParent(),
909896
None,
910897
false};
@@ -927,7 +914,6 @@ UnqualifiedLookupFactory::lookupInMiscContext(
927914
isa<TypeAliasDecl>(dc) ||
928915
isa<SubscriptDecl>(dc));
929916
return PerDeclInfo{
930-
false,
931917
dc,
932918
None,
933919
resolveIsCascadingUse(DC, isCascadingUse,
@@ -1757,7 +1743,6 @@ void UnqualifiedLookupFactory::dumpBreadcrumbs() const {
17571743

17581744
void UnqualifiedLookupFactory::PerDeclInfo::dump() const {
17591745
auto &e = llvm::errs();
1760-
e << (isDoneWithThisDecl ? "done: " : "not done: ");
17611746
e << " dc: ";
17621747
lookupContextForThisDecl->dumpContext();
17631748
if (placesToSearch.hasValue())

0 commit comments

Comments
 (0)