Skip to content

Commit cd48cd6

Browse files
committed
Format
1 parent 1595efe commit cd48cd6

File tree

3 files changed

+555
-566
lines changed

3 files changed

+555
-566
lines changed

include/swift/AST/NameLookup.h

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -445,28 +445,28 @@ void lookupInModule(ModuleDecl *module, ModuleDecl::AccessPathTy accessPath,
445445
LazyResolver *typeResolver,
446446
const DeclContext *moduleScopeContext,
447447
ArrayRef<ModuleDecl::ImportedModule> extraImports = {});
448-
449-
template <typename Fn>
450-
void forAllVisibleModules(const DeclContext *DC, const Fn &fn) {
451-
DeclContext *moduleScope = DC->getModuleScopeContext();
452-
if (auto file = dyn_cast<FileUnit>(moduleScope))
453-
file->forAllVisibleModules(fn);
454-
else
455-
cast<ModuleDecl>(moduleScope)->forAllVisibleModules(ModuleDecl::AccessPathTy(), fn);
456-
}
457-
458-
/// Only name lookup has gathered a set of results, perform any necessary
459-
/// steps to prune the result set before returning it to the caller.
460-
bool finishLookup(const DeclContext *dc, NLOptions options,
461-
SmallVectorImpl<ValueDecl *> &decls);
462-
463-
template <typename Result>
464-
void filterForDiscriminator(SmallVectorImpl<Result> &results,
465-
DebuggerClient *debugClient);
466-
467-
void recordLookupOfTopLevelName(DeclContext *topLevelContext,
468-
DeclName name,
469-
bool isCascading);
448+
449+
template <typename Fn>
450+
void forAllVisibleModules(const DeclContext *DC, const Fn &fn) {
451+
DeclContext *moduleScope = DC->getModuleScopeContext();
452+
if (auto file = dyn_cast<FileUnit>(moduleScope))
453+
file->forAllVisibleModules(fn);
454+
else
455+
cast<ModuleDecl>(moduleScope)
456+
->forAllVisibleModules(ModuleDecl::AccessPathTy(), fn);
457+
}
458+
459+
/// Only name lookup has gathered a set of results, perform any necessary
460+
/// steps to prune the result set before returning it to the caller.
461+
bool finishLookup(const DeclContext *dc, NLOptions options,
462+
SmallVectorImpl<ValueDecl *> &decls);
463+
464+
template <typename Result>
465+
void filterForDiscriminator(SmallVectorImpl<Result> &results,
466+
DebuggerClient *debugClient);
467+
468+
void recordLookupOfTopLevelName(DeclContext *topLevelContext, DeclName name,
469+
bool isCascading);
470470

471471
} // end namespace namelookup
472472

lib/AST/NameLookup.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ matchDiscriminator(Identifier discriminator,
513513

514514
template <typename Result>
515515
void namelookup::filterForDiscriminator(SmallVectorImpl<Result> &results,
516-
DebuggerClient *debugClient) {
516+
DebuggerClient *debugClient) {
517517
Identifier discriminator = debugClient->getPreferredPrivateDiscriminator();
518518
if (discriminator.empty())
519519
return;
@@ -537,16 +537,11 @@ void namelookup::filterForDiscriminator(SmallVectorImpl<Result> &results,
537537
results.push_back(lastMatch);
538538
}
539539

540-
template
541-
void namelookup::filterForDiscriminator<LookupResultEntry>
542-
(SmallVectorImpl<LookupResultEntry> &results,
543-
DebuggerClient *debugClient);
544-
545-
540+
template void namelookup::filterForDiscriminator<LookupResultEntry>(
541+
SmallVectorImpl<LookupResultEntry> &results, DebuggerClient *debugClient);
546542

547543
void namelookup::recordLookupOfTopLevelName(DeclContext *topLevelContext,
548-
DeclName name,
549-
bool isCascading) {
544+
DeclName name, bool isCascading) {
550545
auto SF = dyn_cast<SourceFile>(topLevelContext);
551546
if (!SF)
552547
return;
@@ -1378,7 +1373,7 @@ static bool isAcceptableLookupResult(const DeclContext *dc,
13781373
}
13791374

13801375
bool namelookup::finishLookup(const DeclContext *dc, NLOptions options,
1381-
SmallVectorImpl<ValueDecl *> &decls) {
1376+
SmallVectorImpl<ValueDecl *> &decls) {
13821377
// If we're supposed to remove overridden declarations, do so now.
13831378
if (options & NL_RemoveOverridden)
13841379
removeOverriddenDecls(decls);

0 commit comments

Comments
 (0)