Skip to content

Commit 2593a35

Browse files
committed
[NFC] AST: Remove BoundGeneric*Type::get forwarders
1 parent 49c312a commit 2593a35

File tree

7 files changed

+7
-29
lines changed

7 files changed

+7
-29
lines changed

include/swift/AST/Types.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,13 +2262,6 @@ class BoundGenericClassType final : public BoundGenericType,
22622262
friend class BoundGenericType;
22632263

22642264
public:
2265-
static BoundGenericClassType* get(ClassDecl *theDecl, Type parent,
2266-
ArrayRef<Type> genericArgs) {
2267-
return cast<BoundGenericClassType>(
2268-
BoundGenericType::get(reinterpret_cast<NominalTypeDecl*>(theDecl),
2269-
parent, genericArgs));
2270-
}
2271-
22722265
/// Returns the declaration that declares this type.
22732266
ClassDecl *getDecl() const {
22742267
return reinterpret_cast<ClassDecl*>(BoundGenericType::getDecl());
@@ -2296,13 +2289,6 @@ class BoundGenericEnumType final : public BoundGenericType,
22962289
friend class BoundGenericType;
22972290

22982291
public:
2299-
static BoundGenericEnumType* get(EnumDecl *theDecl, Type parent,
2300-
ArrayRef<Type> genericArgs) {
2301-
return cast<BoundGenericEnumType>(
2302-
BoundGenericType::get(reinterpret_cast<NominalTypeDecl*>(theDecl),
2303-
parent, genericArgs));
2304-
}
2305-
23062292
/// Returns the declaration that declares this type.
23072293
EnumDecl *getDecl() const {
23082294
return reinterpret_cast<EnumDecl*>(BoundGenericType::getDecl());
@@ -2330,13 +2316,6 @@ class BoundGenericStructType final : public BoundGenericType,
23302316
friend class BoundGenericType;
23312317

23322318
public:
2333-
static BoundGenericStructType* get(StructDecl *theDecl, Type parent,
2334-
ArrayRef<Type> genericArgs) {
2335-
return cast<BoundGenericStructType>(
2336-
BoundGenericType::get(reinterpret_cast<NominalTypeDecl*>(theDecl),
2337-
parent, genericArgs));
2338-
}
2339-
23402319
/// Returns the declaration that declares this type.
23412320
StructDecl *getDecl() const {
23422321
return reinterpret_cast<StructDecl*>(BoundGenericType::getDecl());

lib/AST/ASTDemangler.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,8 +693,7 @@ Type ASTBuilder::createBoundGenericObjCClassType(StringRef name,
693693
parent = dc->getDeclaredInterfaceType();
694694
}
695695

696-
return BoundGenericClassType::get(cast<ClassDecl>(typeDecl),
697-
parent, args);
696+
return BoundGenericType::get(cast<ClassDecl>(typeDecl), parent, args);
698697
}
699698

700699
ProtocolDecl *ASTBuilder::createObjCProtocolDecl(StringRef name) {

lib/AST/Builtins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,7 @@ static ValueDecl *getConvertUnownedUnsafeToGuaranteed(ASTContext &ctx,
13311331

13321332
static ValueDecl *getPoundAssert(ASTContext &Context, Identifier Id) {
13331333
auto int1Type = BuiltinIntegerType::get(1, Context);
1334-
auto optionalRawPointerType = BoundGenericEnumType::get(
1334+
auto optionalRawPointerType = BoundGenericType::get(
13351335
Context.getOptionalDecl(), Type(), {Context.TheRawPointerType});
13361336
return getBuiltinFunction(Id, {int1Type, optionalRawPointerType},
13371337
Context.TheEmptyTupleType);

lib/ClangImporter/ImportType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ namespace {
973973
}
974974
}
975975
assert(importedTypeArgs.size() == typeParamCount);
976-
importedType = BoundGenericClassType::get(
976+
importedType = BoundGenericType::get(
977977
imported, nullptr, importedTypeArgs);
978978
} else {
979979
importedType = imported->getDeclaredType();

lib/IRGen/MetadataRequest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2915,7 +2915,7 @@ class EmitTypeMetadataRefForLayout
29152915
return ty;
29162916
auto &C = ty->getASTContext();
29172917
auto optDecl = C.getOptionalDecl();
2918-
return CanType(BoundGenericEnumType::get(optDecl, Type(), payloadTy));
2918+
return CanType(BoundGenericType::get(optDecl, Type(), payloadTy));
29192919
}
29202920

29212921
// Otherwise, generic arguments are not lowered.

lib/SIL/IR/SILType.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ SILType SILType::getBuiltinWordType(const ASTContext &C) {
7171

7272
SILType SILType::getOptionalType(SILType type) {
7373
auto &ctx = type.getASTContext();
74-
auto optType = BoundGenericEnumType::get(ctx.getOptionalDecl(), Type(),
75-
{ type.getASTType() });
74+
auto optType = BoundGenericType::get(ctx.getOptionalDecl(), Type(),
75+
{ type.getASTType() });
7676
return getPrimitiveType(CanType(optType), type.getCategory());
7777
}
7878

lib/SIL/IR/TypeLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1674,7 +1674,7 @@ static CanType computeLoweredOptionalType(TypeConverter &tc,
16741674
}
16751675

16761676
auto optDecl = tc.Context.getOptionalDecl();
1677-
return CanType(BoundGenericEnumType::get(optDecl, Type(), loweredObjectType));
1677+
return CanType(BoundGenericType::get(optDecl, Type(), loweredObjectType));
16781678
}
16791679

16801680
static CanType

0 commit comments

Comments
 (0)