Skip to content

Commit c777bc0

Browse files
committed
[NFC] AST: Consistently capitalize parameter and local variable names in BoundGeneric*Type
1 parent 2593a35 commit c777bc0

File tree

2 files changed

+38
-38
lines changed

2 files changed

+38
-38
lines changed

include/swift/AST/Types.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,9 +2214,9 @@ class BoundGenericType : public NominalOrBoundGenericNominalType,
22142214
}
22152215

22162216
protected:
2217-
BoundGenericType(TypeKind theKind, NominalTypeDecl *theDecl, Type parent,
2218-
ArrayRef<Type> genericArgs, const ASTContext *context,
2219-
RecursiveTypeProperties properties);
2217+
BoundGenericType(TypeKind K, NominalTypeDecl *TheDecl, Type Parent,
2218+
ArrayRef<Type> GenericArgs, const ASTContext *C,
2219+
RecursiveTypeProperties Properties);
22202220

22212221
public:
22222222
static BoundGenericType* get(NominalTypeDecl *TheDecl, Type Parent,
@@ -2253,12 +2253,12 @@ class BoundGenericClassType final : public BoundGenericType,
22532253
friend TrailingObjects;
22542254

22552255
private:
2256-
BoundGenericClassType(ClassDecl *theDecl, Type parent,
2257-
ArrayRef<Type> genericArgs, const ASTContext *context,
2258-
RecursiveTypeProperties properties)
2256+
BoundGenericClassType(ClassDecl *TheDecl, Type Parent,
2257+
ArrayRef<Type> GenericArgs, const ASTContext *C,
2258+
RecursiveTypeProperties Properties)
22592259
: BoundGenericType(TypeKind::BoundGenericClass,
2260-
reinterpret_cast<NominalTypeDecl*>(theDecl), parent,
2261-
genericArgs, context, properties) {}
2260+
reinterpret_cast<NominalTypeDecl*>(TheDecl), Parent,
2261+
GenericArgs, C, Properties) {}
22622262
friend class BoundGenericType;
22632263

22642264
public:
@@ -2280,12 +2280,12 @@ class BoundGenericEnumType final : public BoundGenericType,
22802280
friend TrailingObjects;
22812281

22822282
private:
2283-
BoundGenericEnumType(EnumDecl *theDecl, Type parent,
2284-
ArrayRef<Type> genericArgs, const ASTContext *context,
2285-
RecursiveTypeProperties properties)
2283+
BoundGenericEnumType(EnumDecl *TheDecl, Type Parent,
2284+
ArrayRef<Type> GenericArgs, const ASTContext *C,
2285+
RecursiveTypeProperties Properties)
22862286
: BoundGenericType(TypeKind::BoundGenericEnum,
2287-
reinterpret_cast<NominalTypeDecl*>(theDecl), parent,
2288-
genericArgs, context, properties) {}
2287+
reinterpret_cast<NominalTypeDecl*>(TheDecl), Parent,
2288+
GenericArgs, C, Properties) {}
22892289
friend class BoundGenericType;
22902290

22912291
public:
@@ -2307,12 +2307,12 @@ class BoundGenericStructType final : public BoundGenericType,
23072307
friend TrailingObjects;
23082308

23092309
private:
2310-
BoundGenericStructType(StructDecl *theDecl, Type parent,
2311-
ArrayRef<Type> genericArgs, const ASTContext *context,
2312-
RecursiveTypeProperties properties)
2310+
BoundGenericStructType(StructDecl *TheDecl, Type Parent,
2311+
ArrayRef<Type> GenericArgs, const ASTContext *C,
2312+
RecursiveTypeProperties Properties)
23132313
: BoundGenericType(TypeKind::BoundGenericStruct,
2314-
reinterpret_cast<NominalTypeDecl*>(theDecl), parent,
2315-
genericArgs, context, properties) {}
2314+
reinterpret_cast<NominalTypeDecl*>(TheDecl), Parent,
2315+
GenericArgs, C, Properties) {}
23162316
friend class BoundGenericType;
23172317

23182318
public:

lib/AST/ASTContext.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2591,17 +2591,17 @@ BoundGenericType *BoundGenericType::get(NominalTypeDecl *TheDecl,
25912591
ASTContext &C = TheDecl->getDeclContext()->getASTContext();
25922592
llvm::FoldingSetNodeID ID;
25932593
BoundGenericType::Profile(ID, TheDecl, Parent, GenericArgs);
2594-
RecursiveTypeProperties properties;
2595-
if (Parent) properties |= Parent->getRecursiveProperties();
2594+
RecursiveTypeProperties Properties;
2595+
if (Parent) Properties |= Parent->getRecursiveProperties();
25962596
for (Type Arg : GenericArgs) {
2597-
properties |= Arg->getRecursiveProperties();
2597+
Properties |= Arg->getRecursiveProperties();
25982598
}
25992599

2600-
auto arena = getArena(properties);
2600+
const auto Arena = getArena(Properties);
26012601

26022602
void *InsertPos = nullptr;
26032603
if (BoundGenericType *BGT =
2604-
C.getImpl().getArena(arena).BoundGenericTypes.FindNodeOrInsertPos(ID,
2604+
C.getImpl().getArena(Arena).BoundGenericTypes.FindNodeOrInsertPos(ID,
26052605
InsertPos))
26062606
return BGT;
26072607

@@ -2615,28 +2615,28 @@ BoundGenericType *BoundGenericType::get(NominalTypeDecl *TheDecl,
26152615
}
26162616
}
26172617

2618-
BoundGenericType *newType;
2619-
if (auto theClass = dyn_cast<ClassDecl>(TheDecl)) {
2618+
BoundGenericType *BGT;
2619+
if (auto *const CD = dyn_cast<ClassDecl>(TheDecl)) {
26202620
auto sz = BoundGenericClassType::totalSizeToAlloc<Type>(GenericArgs.size());
2621-
auto mem = C.Allocate(sz, alignof(BoundGenericClassType), arena);
2622-
newType = new (mem) BoundGenericClassType(
2623-
theClass, Parent, GenericArgs, IsCanonical ? &C : nullptr, properties);
2624-
} else if (auto theStruct = dyn_cast<StructDecl>(TheDecl)) {
2621+
auto Mem = C.Allocate(sz, alignof(BoundGenericClassType), Arena);
2622+
BGT = new (Mem) BoundGenericClassType(
2623+
CD, Parent, GenericArgs, IsCanonical ? &C : nullptr, Properties);
2624+
} else if (auto *const SD = dyn_cast<StructDecl>(TheDecl)) {
26252625
auto sz =BoundGenericStructType::totalSizeToAlloc<Type>(GenericArgs.size());
2626-
auto mem = C.Allocate(sz, alignof(BoundGenericStructType), arena);
2627-
newType = new (mem) BoundGenericStructType(
2628-
theStruct, Parent, GenericArgs, IsCanonical ? &C : nullptr, properties);
2629-
} else if (auto theEnum = dyn_cast<EnumDecl>(TheDecl)) {
2626+
auto Mem = C.Allocate(sz, alignof(BoundGenericStructType), Arena);
2627+
BGT = new (Mem) BoundGenericStructType(
2628+
SD, Parent, GenericArgs, IsCanonical ? &C : nullptr, Properties);
2629+
} else if (auto *const ED = dyn_cast<EnumDecl>(TheDecl)) {
26302630
auto sz = BoundGenericEnumType::totalSizeToAlloc<Type>(GenericArgs.size());
2631-
auto mem = C.Allocate(sz, alignof(BoundGenericEnumType), arena);
2632-
newType = new (mem) BoundGenericEnumType(
2633-
theEnum, Parent, GenericArgs, IsCanonical ? &C : nullptr, properties);
2631+
auto Mem = C.Allocate(sz, alignof(BoundGenericEnumType), Arena);
2632+
BGT = new (Mem) BoundGenericEnumType(
2633+
ED, Parent, GenericArgs, IsCanonical ? &C : nullptr, Properties);
26342634
} else {
26352635
llvm_unreachable("Unhandled NominalTypeDecl");
26362636
}
2637-
C.getImpl().getArena(arena).BoundGenericTypes.InsertNode(newType, InsertPos);
2637+
C.getImpl().getArena(Arena).BoundGenericTypes.InsertNode(BGT, InsertPos);
26382638

2639-
return newType;
2639+
return BGT;
26402640
}
26412641

26422642
NominalType *NominalType::get(NominalTypeDecl *D, Type Parent, const ASTContext &C) {

0 commit comments

Comments
 (0)