Skip to content

Commit c936b27

Browse files
committed
Revert "[AST] Added hasConcretePack recursive property."
This reverts commit 6c1642f.
1 parent 7b0a8a2 commit c936b27

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

include/swift/AST/Types.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,7 @@ class RecursiveTypeProperties {
173173
/// This type contains an ElementArchetype.
174174
HasElementArchetype = 0x4000,
175175

176-
/// This type contains a concrete pack.
177-
HasConcretePack = 0x8000,
178-
179-
Last_Property = HasConcretePack
176+
Last_Property = HasElementArchetype
180177
};
181178
enum { BitWidth = countBitsUsed(Property::Last_Property) };
182179

@@ -246,8 +243,6 @@ class RecursiveTypeProperties {
246243

247244
bool hasParameterPack() const { return Bits & HasParameterPack; }
248245

249-
bool hasConcretePack() const { return Bits & HasConcretePack; }
250-
251246
/// Does a type with these properties structurally contain a
252247
/// parameterized existential type?
253248
bool hasParameterizedExistential() const {
@@ -675,13 +670,6 @@ class alignas(1 << TypeAlignInBits) TypeBase
675670
return getRecursiveProperties().hasParameterPack();
676671
}
677672

678-
bool hasConcretePack() const {
679-
return getRecursiveProperties().hasConcretePack();
680-
}
681-
682-
/// Whether the type has some flavor of pack.
683-
bool hasPack() const { return hasParameterPack() || hasConcretePack(); }
684-
685673
/// Determine whether the type involves a parameterized existential type.
686674
bool hasParameterizedExistential() const {
687675
return getRecursiveProperties().hasParameterizedExistential();

lib/AST/ASTContext.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3312,7 +3312,7 @@ CanPackType CanPackType::get(const ASTContext &C,
33123312
}
33133313

33143314
PackType *PackType::get(const ASTContext &C, ArrayRef<Type> elements) {
3315-
RecursiveTypeProperties properties = RecursiveTypeProperties::HasConcretePack;
3315+
RecursiveTypeProperties properties;
33163316
bool isCanonical = true;
33173317
for (Type eltTy : elements) {
33183318
assert(!eltTy->is<PackType>() &&
@@ -3352,7 +3352,7 @@ void PackType::Profile(llvm::FoldingSetNodeID &ID, ArrayRef<Type> Elements) {
33523352

33533353
CanSILPackType SILPackType::get(const ASTContext &C, ExtInfo info,
33543354
ArrayRef<CanType> elements) {
3355-
RecursiveTypeProperties properties = RecursiveTypeProperties::HasConcretePack;
3355+
RecursiveTypeProperties properties;
33563356
for (CanType eltTy : elements) {
33573357
assert(!isa<SILPackType>(eltTy) &&
33583358
"Cannot have pack directly inside another pack");
@@ -3944,7 +3944,7 @@ isAnyFunctionTypeCanonical(ArrayRef<AnyFunctionType::Param> params,
39443944
static RecursiveTypeProperties
39453945
getGenericFunctionRecursiveProperties(ArrayRef<AnyFunctionType::Param> params,
39463946
Type result) {
3947-
static_assert(RecursiveTypeProperties::BitWidth == 16,
3947+
static_assert(RecursiveTypeProperties::BitWidth == 15,
39483948
"revisit this if you add new recursive type properties");
39493949
RecursiveTypeProperties properties;
39503950

@@ -4604,7 +4604,7 @@ CanSILFunctionType SILFunctionType::get(
46044604
void *mem = ctx.Allocate(bytes, alignof(SILFunctionType));
46054605

46064606
RecursiveTypeProperties properties;
4607-
static_assert(RecursiveTypeProperties::BitWidth == 16,
4607+
static_assert(RecursiveTypeProperties::BitWidth == 15,
46084608
"revisit this if you add new recursive type properties");
46094609
for (auto &param : params)
46104610
properties |= param.getInterfaceType()->getRecursiveProperties();

0 commit comments

Comments
 (0)