Skip to content

Commit 05615fa

Browse files
committed
NFC: Rename TypeWalker's SkipChildren to SkipNode
For consistency with ASTWalker.
1 parent 16cfca4 commit 05615fa

15 files changed

+32
-32
lines changed

include/swift/AST/TypeWalker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class TypeWalker {
2222
public:
2323
enum class Action {
2424
Continue,
25-
SkipChildren,
25+
SkipNode,
2626
Stop
2727
};
2828

lib/AST/Decl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6269,7 +6269,7 @@ bool ClassDecl::walkSuperclasses(
62696269
switch (fn(cls)) {
62706270
case TypeWalker::Action::Stop:
62716271
return true;
6272-
case TypeWalker::Action::SkipChildren:
6272+
case TypeWalker::Action::SkipNode:
62736273
return false;
62746274
case TypeWalker::Action::Continue:
62756275
cls = cls->getSuperclassDecl();
@@ -6597,7 +6597,7 @@ bool ProtocolDecl::walkInheritedProtocols(
65976597
}
65986598
break;
65996599

6600-
case TypeWalker::Action::SkipChildren:
6600+
case TypeWalker::Action::SkipNode:
66016601
break;
66026602
}
66036603
}

lib/AST/ParameterPack.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ struct PackReferenceCollector: TypeWalker {
109109
for (auto type : boundGenericType->getExpandedGenericArgs())
110110
type.walk(*this);
111111

112-
return Action::SkipChildren;
112+
return Action::SkipNode;
113113
}
114114

115115
if (auto *typeAliasType = dyn_cast<TypeAliasType>(t.getPointer())) {
@@ -120,7 +120,7 @@ struct PackReferenceCollector: TypeWalker {
120120
for (auto type : typeAliasType->getExpandedGenericArgs())
121121
type.walk(*this);
122122

123-
return Action::SkipChildren;
123+
return Action::SkipNode;
124124
}
125125
}
126126

lib/AST/RequirementMachine/GenericSignatureQueries.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ bool RequirementMachine::isReducedType(Type type) const {
305305

306306
Action walkToTypePre(Type component) override {
307307
if (!component->hasTypeParameter())
308-
return Action::SkipChildren;
308+
return Action::SkipNode;
309309

310310
if (!component->isTypeParameter())
311311
return Action::Continue;
@@ -327,7 +327,7 @@ bool RequirementMachine::isReducedType(Type type) const {
327327

328328
// The parent of a reduced type parameter might be non-reduced
329329
// because it is concrete.
330-
return Action::SkipChildren;
330+
return Action::SkipNode;
331331
}
332332
};
333333

lib/AST/RequirementMachine/RequirementLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ struct InferRequirementsWalker : public TypeWalker {
536536
return Action::Stop;
537537

538538
if (!ty->hasTypeParameter())
539-
return Action::SkipChildren;
539+
return Action::SkipNode;
540540

541541
return Action::Continue;
542542
}

lib/AST/TypeWalker.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class Traversal : public TypeVisitor<Traversal, bool>
283283
switch (Walker.walkToTypePre(ty)) {
284284
case TypeWalker::Action::Continue:
285285
break;
286-
case TypeWalker::Action::SkipChildren:
286+
case TypeWalker::Action::SkipNode:
287287
return false;
288288
case TypeWalker::Action::Stop:
289289
return true;
@@ -297,7 +297,7 @@ class Traversal : public TypeVisitor<Traversal, bool>
297297
switch (Walker.walkToTypePost(ty)) {
298298
case TypeWalker::Action::Continue:
299299
return false;
300-
case TypeWalker::Action::SkipChildren:
300+
case TypeWalker::Action::SkipNode:
301301
llvm_unreachable("SkipChildren is not valid for a post-visit check");
302302
case TypeWalker::Action::Stop:
303303
return true;

lib/Frontend/ModuleInterfaceSupport.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ class InheritedProtocolCollector {
693693
proto->walkInheritedProtocols(
694694
[&](ProtocolDecl *inherited) -> TypeWalker::Action {
695695
if (!handledProtocols.insert(inherited).second)
696-
return TypeWalker::Action::SkipChildren;
696+
return TypeWalker::Action::SkipNode;
697697

698698
// If 'nominal' is an actor, we do not synthesize its conformance
699699
// to the Actor protocol through a dummy extension.
@@ -702,14 +702,14 @@ class InheritedProtocolCollector {
702702
// not extensions of that 'actor'.
703703
if (actorClass &&
704704
inherited->isSpecificProtocol(KnownProtocolKind::Actor))
705-
return TypeWalker::Action::SkipChildren;
705+
return TypeWalker::Action::SkipNode;
706706

707707
// Do not synthesize an extension to print a conformance to an
708708
// invertible protocol, as their conformances are always re-inferred
709709
// using the interface itself.
710710
if (auto kp = inherited->getKnownProtocolKind())
711711
if (getInvertibleProtocolKind(*kp))
712-
return TypeWalker::Action::SkipChildren;
712+
return TypeWalker::Action::SkipNode;
713713

714714
if (inherited->isSPI() && printOptions.printPublicInterface())
715715
return TypeWalker::Action::Continue;
@@ -721,7 +721,7 @@ class InheritedProtocolCollector {
721721
inherited, availability, isUnchecked, otherAttrs);
722722
printSynthesizedExtension(out, extensionPrintOptions, M, nominal,
723723
protoAndAvailability);
724-
return TypeWalker::Action::SkipChildren;
724+
return TypeWalker::Action::SkipNode;
725725
}
726726

727727
return TypeWalker::Action::Continue;

lib/PrintAsClang/ModuleContentsWriter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class ReferencedTypeFinder : public TypeDeclFinder {
6161

6262
Action visitNominalType(NominalType *nominal) override {
6363
Callback(*this, nominal->getDecl());
64-
return Action::SkipChildren;
64+
return Action::SkipNode;
6565
}
6666

6767
Action visitTypeAliasType(TypeAliasType *aliasTy) override {
@@ -71,7 +71,7 @@ class ReferencedTypeFinder : public TypeDeclFinder {
7171
} else {
7272
Type(aliasTy->getSinglyDesugaredType()).walk(*this);
7373
}
74-
return Action::SkipChildren;
74+
return Action::SkipNode;
7575
}
7676

7777
/// Returns true if \p paramTy has any constraints other than being
@@ -103,7 +103,7 @@ class ReferencedTypeFinder : public TypeDeclFinder {
103103
argTy.walk(*this);
104104
NeedsDefinition = false;
105105
});
106-
return Action::SkipChildren;
106+
return Action::SkipNode;
107107
}
108108

109109
public:

lib/Sema/AssociatedTypeInference.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4400,7 +4400,7 @@ ReferencedAssociatedTypesRequest::evaluate(Evaluator &eval,
44004400
assocTypes.push_back(assocType);
44014401
}
44024402

4403-
return Action::SkipChildren;
4403+
return Action::SkipNode;
44044404
}
44054405

44064406
return Action::Continue;

lib/Sema/CSBindings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ findInferableTypeVars(Type type,
10721072

10731073
Action walkToTypePre(Type ty) override {
10741074
if (ty->is<DependentMemberType>())
1075-
return Action::SkipChildren;
1075+
return Action::SkipNode;
10761076

10771077
if (auto typeVar = ty->getAs<TypeVariableType>())
10781078
typeVars.insert(typeVar);

0 commit comments

Comments
 (0)