Skip to content

Commit 60baf11

Browse files
committed
Remove Type.selfOrAnyFieldHasValueDeinit
It's not needed anymore
1 parent 11c7431 commit 60baf11

File tree

5 files changed

+1
-27
lines changed

5 files changed

+1
-27
lines changed

SwiftCompilerSources/Sources/SIL/Type.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ public struct Type : CustomStringConvertible, NoReflectionChildren {
4343
return bridged.isReferenceCounted(function.bridged)
4444
}
4545

46-
public func selfOrAnyFieldHasValueDeinit(in function: Function) -> Bool {
47-
return bridged.selfOrAnyFieldHasValueDeinit(function.bridged)
48-
}
49-
5046
public var isUnownedStorageType: Bool {
5147
return bridged.isUnownedStorageType()
5248
}

include/swift/SIL/SILBridging.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ struct BridgedType {
115115
BRIDGED_INLINE bool isValueTypeWithDeinit() const;
116116
BRIDGED_INLINE bool isLoadable(BridgedFunction f) const;
117117
BRIDGED_INLINE bool isReferenceCounted(BridgedFunction f) const;
118-
BRIDGED_INLINE bool selfOrAnyFieldHasValueDeinit(BridgedFunction f) const;
119118
BRIDGED_INLINE bool isUnownedStorageType() const;
120119
BRIDGED_INLINE bool hasArchetype() const;
121120
BRIDGED_INLINE bool isNominalOrBoundGenericNominal() const;

include/swift/SIL/SILBridgingImpl.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,6 @@ bool BridgedType::isReferenceCounted(BridgedFunction f) const {
8888
return unbridged().isReferenceCounted(f.getFunction());
8989
}
9090

91-
bool BridgedType::selfOrAnyFieldHasValueDeinit(BridgedFunction f) const {
92-
swift::SILType contextType = unbridged().hasTypeParameter() ? f.getFunction()->mapTypeIntoContext(unbridged())
93-
: unbridged();
94-
return f.getFunction()->getTypeLowering(contextType).selfOrAnyFieldHasValueDeinit();
95-
}
96-
9791
bool BridgedType::isUnownedStorageType() const {
9892
return unbridged().isUnownedStorageType();
9993
}

include/swift/SIL/TypeLowering.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,10 @@ class TypeLowering {
192192
InfiniteFlag = 1 << 5,
193193
HasRawPointerFlag = 1 << 6,
194194
LexicalFlag = 1 << 7,
195-
HasValueDeinitFlag = 1 << 8,
196195
};
197196
// clang-format on
198197

199-
uint16_t Flags;
198+
uint8_t Flags;
200199
public:
201200
/// Construct a default RecursiveProperties, which corresponds to
202201
/// a trivial, loadable, fixed-layout type.
@@ -273,9 +272,6 @@ class TypeLowering {
273272
IsLexical_t isLexical() const {
274273
return IsLexical_t((Flags & LexicalFlag) != 0);
275274
}
276-
bool hasValueDeinit() const {
277-
return (Flags & HasValueDeinitFlag) != 0;
278-
}
279275

280276
void setNonTrivial() { Flags |= NonTrivialFlag; }
281277
void setNonFixedABI() { Flags |= NonFixedABIFlag; }
@@ -289,7 +285,6 @@ class TypeLowering {
289285
void setLexical(IsLexical_t isLexical) {
290286
Flags = (Flags & ~LexicalFlag) | (isLexical ? LexicalFlag : 0);
291287
}
292-
void setHasValueDeinit() { Flags |= HasValueDeinitFlag; }
293288
};
294289

295290
private:
@@ -368,10 +363,6 @@ class TypeLowering {
368363
return Properties.isOrContainsRawPointer();
369364
}
370365

371-
bool selfOrAnyFieldHasValueDeinit() const {
372-
return Properties.hasValueDeinit();
373-
}
374-
375366
/// Returns true if the type is a scalar reference-counted reference, which
376367
/// can be retained and released.
377368
bool isReferenceCounted() const {

lib/SIL/IR/TypeLowering.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,9 +2369,6 @@ namespace {
23692369
properties.setLexical(IsLexical);
23702370
return handleMoveOnlyAddressOnly(structType, properties);
23712371
}
2372-
if (D->getValueTypeDestructor()) {
2373-
properties.setHasValueDeinit();
2374-
}
23752372

23762373
auto subMap = structType->getContextSubstitutionMap(&TC.M, D);
23772374

@@ -2454,9 +2451,6 @@ namespace {
24542451
return new (TC) LoadableEnumTypeLowering(enumType, properties,
24552452
Expansion);
24562453
}
2457-
if (D->getValueTypeDestructor()) {
2458-
properties.setHasValueDeinit();
2459-
}
24602454

24612455
auto subMap = enumType->getContextSubstitutionMap(&TC.M, D);
24622456

0 commit comments

Comments
 (0)