Skip to content

Commit 34df231

Browse files
committed
LookupVisibleDecls: Remove an unused variable
1 parent 854282b commit 34df231

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/AST/LookupVisibleDecls.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,6 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
850850
// and if so, whether this is a reference to one of them.
851851
while (!DC->isModuleScopeContext()) {
852852
GenericParamList *GenericParams = nullptr;
853-
const ValueDecl *BaseDecl = nullptr;
854853
Type ExtendedType;
855854
auto LS = LookupState::makeUnqualified();
856855

@@ -874,7 +873,6 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
874873
if (auto *SE = dyn_cast<SubscriptDecl>(DC)) {
875874
ExtendedType = SE->getDeclContext()->getSelfTypeInContext();
876875
DC = DC->getParent();
877-
BaseDecl = DC->getSelfNominalTypeDecl();
878876
} else if (auto *AFD = dyn_cast<AbstractFunctionDecl>(DC)) {
879877

880878
// Look for local variables; normally, the parser resolves these
@@ -897,7 +895,6 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
897895

898896
if (AFD->getDeclContext()->isTypeContext()) {
899897
ExtendedType = AFD->getDeclContext()->getSelfTypeInContext();
900-
BaseDecl = AFD->getImplicitSelfDecl();
901898
DC = DC->getParent();
902899

903900
if (auto *FD = dyn_cast<FuncDecl>(AFD))
@@ -913,11 +910,8 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
913910
}
914911
} else if (auto ED = dyn_cast<ExtensionDecl>(DC)) {
915912
ExtendedType = ED->getSelfTypeInContext();
916-
if (ExtendedType)
917-
BaseDecl = ExtendedType->getNominalOrBoundGenericNominal();
918913
} else if (auto ND = dyn_cast<NominalTypeDecl>(DC)) {
919914
ExtendedType = ND->getSelfTypeInContext();
920-
BaseDecl = ND;
921915
}
922916

923917
// If we're inside a function context, we've already moved to
@@ -943,7 +937,7 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
943937
dcGenericParams = dcGenericParams->getOuterParameters();
944938
}
945939

946-
if (BaseDecl && ExtendedType)
940+
if (ExtendedType)
947941
::lookupVisibleMemberDecls(ExtendedType, Consumer, DC, LS, Reason,
948942
TypeResolver, nullptr);
949943

0 commit comments

Comments
 (0)