Skip to content

Commit 46dd33a

Browse files
committed
LookupVisibleDecls: Remove an unused variable
1 parent f7e3944 commit 46dd33a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/Sema/LookupVisibleDecls.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,6 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
845845
// and if so, whether this is a reference to one of them.
846846
while (!DC->isModuleScopeContext()) {
847847
GenericParamList *GenericParams = nullptr;
848-
const ValueDecl *BaseDecl = nullptr;
849848
Type ExtendedType;
850849
auto LS = LookupState::makeUnqualified();
851850

@@ -869,7 +868,6 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
869868
if (auto *SE = dyn_cast<SubscriptDecl>(DC)) {
870869
ExtendedType = SE->getDeclContext()->getSelfTypeInContext();
871870
DC = DC->getParent();
872-
BaseDecl = DC->getSelfNominalTypeDecl();
873871
} else if (auto *AFD = dyn_cast<AbstractFunctionDecl>(DC)) {
874872

875873
// Look for local variables; normally, the parser resolves these
@@ -892,7 +890,6 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
892890

893891
if (AFD->getDeclContext()->isTypeContext()) {
894892
ExtendedType = AFD->getDeclContext()->getSelfTypeInContext();
895-
BaseDecl = AFD->getImplicitSelfDecl();
896893
DC = DC->getParent();
897894

898895
if (auto *FD = dyn_cast<FuncDecl>(AFD))
@@ -908,11 +905,8 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
908905
}
909906
} else if (auto ED = dyn_cast<ExtensionDecl>(DC)) {
910907
ExtendedType = ED->getSelfTypeInContext();
911-
if (ExtendedType)
912-
BaseDecl = ExtendedType->getNominalOrBoundGenericNominal();
913908
} else if (auto ND = dyn_cast<NominalTypeDecl>(DC)) {
914909
ExtendedType = ND->getSelfTypeInContext();
915-
BaseDecl = ND;
916910
}
917911

918912
// If we're inside a function context, we've already moved to
@@ -938,7 +932,7 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
938932
dcGenericParams = dcGenericParams->getOuterParameters();
939933
}
940934

941-
if (BaseDecl && ExtendedType)
935+
if (ExtendedType)
942936
::lookupVisibleMemberDecls(ExtendedType, Consumer, DC, LS, Reason,
943937
TypeResolver, nullptr);
944938

0 commit comments

Comments
 (0)