Skip to content

Commit f48b268

Browse files
authored
Merge pull request #892 from hamishknight/hello-operator
2 parents c885dbf + 40770c3 commit f48b268

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

lldb/source/Symbol/SwiftASTContext.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "swift/AST/ImportCache.h"
3232
#include "swift/AST/ModuleLoader.h"
3333
#include "swift/AST/NameLookup.h"
34+
#include "swift/AST/OperatorNameLookup.h"
3435
#include "swift/AST/SearchPathOptions.h"
3536
#include "swift/AST/SubstitutionMap.h"
3637
#include "swift/AST/Type.h"
@@ -4495,18 +4496,17 @@ size_t SwiftASTContext::FindTypesOrDecls(const char *name,
44954496
swift_module->lookupValue(identifier, swift::NLKind::UnqualifiedLookup,
44964497
value_decls);
44974498
if (identifier.isOperator()) {
4498-
swift::OperatorDecl *op_decl =
4499-
swift_module->lookupPrefixOperator(identifier);
4500-
if (op_decl)
4501-
results.emplace(DeclToTypeOrDecl(GetASTContext(), op_decl));
4502-
if ((op_decl = swift_module->lookupInfixOperator(identifier)))
4503-
results.emplace(DeclToTypeOrDecl(GetASTContext(), op_decl));
4504-
if ((op_decl = swift_module->lookupPostfixOperator(identifier)))
4505-
results.emplace(DeclToTypeOrDecl(GetASTContext(), op_decl));
4506-
}
4507-
if (swift::PrecedenceGroupDecl *pg_decl =
4508-
swift_module->lookupPrecedenceGroup(identifier))
4509-
results.emplace(DeclToTypeOrDecl(GetASTContext(), pg_decl));
4499+
if (auto *op = swift_module->lookupPrefixOperator(identifier))
4500+
results.emplace(DeclToTypeOrDecl(GetASTContext(), op));
4501+
4502+
if (auto *op = swift_module->lookupInfixOperator(identifier).getSingle())
4503+
results.emplace(DeclToTypeOrDecl(GetASTContext(), op));
4504+
4505+
if (auto *op = swift_module->lookupPostfixOperator(identifier))
4506+
results.emplace(DeclToTypeOrDecl(GetASTContext(), op));
4507+
}
4508+
if (auto *pg = swift_module->lookupPrecedenceGroup(identifier).getSingle())
4509+
results.emplace(DeclToTypeOrDecl(GetASTContext(), pg));
45104510

45114511
for (auto decl : value_decls)
45124512
results.emplace(DeclToTypeOrDecl(GetASTContext(), decl));

0 commit comments

Comments
 (0)