Skip to content

Commit 8168dda

Browse files
committed
AST: Remove dead code from ASTScopeDeclConsumerForUnqualifiedLookup::consume()
1 parent 06fc9c5 commit 8168dda

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

lib/AST/UnqualifiedLookup.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -584,17 +584,6 @@ bool ASTScopeDeclConsumerForUnqualifiedLookup::consume(
584584
if (!value->getName().matchesRef(factory.Name.getFullName()))
585585
continue;
586586

587-
// In order to preserve the behavior of the existing context-based lookup,
588-
// which finds all results for non-local variables at the top level instead
589-
// of stopping at the first one, ignore results at the top level that are
590-
// not local variables. The caller \c lookInASTScopes will
591-
// then do the appropriate work when the scope lookup fails. In
592-
// FindLocalVal::visitBraceStmt, it sees PatternBindingDecls, not VarDecls,
593-
// so a VarDecl at top level would not be found by the context-based lookup.
594-
if (isa<SourceFile>(value->getDeclContext()) &&
595-
(vis != DeclVisibilityKind::LocalVariable || isa<VarDecl>(value)))
596-
return false;
597-
598587
factory.Results.push_back(LookupResultEntry(value));
599588
#ifndef NDEBUG
600589
factory.stopForDebuggingIfAddingTargetLookupResult(factory.Results.back());

0 commit comments

Comments
 (0)