Skip to content

Commit dfbbd72

Browse files
committed
[NFC] AST: Rename TypeAliasType::getInnermostGenericArgs to getDirectGenericArgs
1 parent 4e7569e commit dfbbd72

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

include/swift/AST/Types.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,13 +1803,10 @@ class TypeAliasType final
18031803
return *getTrailingObjects<SubstitutionMap>();
18041804
}
18051805

1806-
/// Get the innermost generic arguments, which correspond to the generic
1807-
/// arguments that are directly applied to the typealias declaration in
1808-
/// produced by \c getDecl().
1809-
///
1810-
/// The result can be empty, if the declaration itself is non-generic but
1811-
/// the parent is generic.
1812-
SmallVector<Type, 2> getInnermostGenericArgs() const;
1806+
/// Get the direct generic arguments, which correspond to the generic
1807+
/// arguments that are directly applied to the typealias declaration
1808+
/// this type references.
1809+
SmallVector<Type, 2> getDirectGenericArgs() const;
18131810

18141811
// Support for FoldingSet.
18151812
void Profile(llvm::FoldingSetNodeID &id) const;

lib/AST/ASTDumper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3506,7 +3506,7 @@ namespace {
35063506
if (T->getParent())
35073507
printRec("parent", T->getParent());
35083508

3509-
for (auto arg : T->getInnermostGenericArgs())
3509+
for (const auto arg : T->getDirectGenericArgs())
35103510
printRec(arg);
35113511
PrintWithColorRAII(OS, ParenthesisColor) << ')';
35123512
}

lib/AST/ASTPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3727,7 +3727,7 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
37273727
}
37283728

37293729
printQualifiedType(T);
3730-
printGenericArgs(T->getInnermostGenericArgs());
3730+
printGenericArgs(T->getDirectGenericArgs());
37313731
}
37323732

37333733
void visitParenType(ParenType *T) {

lib/AST/Type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ Type SugarType::getSinglyDesugaredTypeSlow() {
13851385
return UnderlyingType;
13861386
}
13871387

1388-
SmallVector<Type, 2> TypeAliasType::getInnermostGenericArgs() const {
1388+
SmallVector<Type, 2> TypeAliasType::getDirectGenericArgs() const {
13891389
SmallVector<Type, 2> result;
13901390

13911391
// If the typealias is not generic, there are no generic arguments

lib/AST/TypeWalker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Traversal : public TypeVisitor<Traversal, bool>
3939
if (auto parent = ty->getParent())
4040
if (doIt(parent)) return true;
4141

42-
for (auto arg : ty->getInnermostGenericArgs())
42+
for (const auto arg : ty->getDirectGenericArgs())
4343
if (doIt(arg))
4444
return true;
4545

0 commit comments

Comments
 (0)