Skip to content

Commit 5adb94c

Browse files
committed
[no-implicit-copy] Remove the move only bit in type lowering for now.
We currently do not need it so I am removing it. We /do/ use move only as a TypeLowering itself though. Just not as a property.
1 parent b9907c6 commit 5adb94c

File tree

2 files changed

+4
-59
lines changed

2 files changed

+4
-59
lines changed

include/swift/SIL/TypeLowering.h

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,6 @@ enum IsInfiniteType_t : bool {
169169
IsInfiniteType = true,
170170
};
171171

172-
/// Does this type contain a move only type that affects type lowering?
173-
enum IsMoveOnly_t : bool {
174-
IsNotMoveOnly = false,
175-
IsMoveOnly = true,
176-
};
177-
178172
/// Extended type information used by SIL.
179173
class TypeLowering {
180174
public:
@@ -190,7 +184,6 @@ class TypeLowering {
190184
TypeExpansionSensitiveFlag = 1 << 4,
191185
InfiniteFlag = 1 << 5,
192186
HasRawPointerFlag = 1 << 6,
193-
MoveOnlyFlag = 1 << 7,
194187
};
195188
// clang-format on
196189

@@ -205,15 +198,13 @@ class TypeLowering {
205198
IsAddressOnly_t isAddressOnly, IsResilient_t isResilient,
206199
IsTypeExpansionSensitive_t isTypeExpansionSensitive =
207200
IsNotTypeExpansionSensitive,
208-
HasRawPointer_t hasRawPointer = DoesNotHaveRawPointer,
209-
IsMoveOnly_t isMoveOnly = IsNotMoveOnly)
201+
HasRawPointer_t hasRawPointer = DoesNotHaveRawPointer)
210202
: Flags((isTrivial ? 0U : NonTrivialFlag) |
211203
(isFixedABI ? 0U : NonFixedABIFlag) |
212204
(isAddressOnly ? AddressOnlyFlag : 0U) |
213205
(isResilient ? ResilientFlag : 0U) |
214206
(isTypeExpansionSensitive ? TypeExpansionSensitiveFlag : 0U) |
215-
(hasRawPointer ? HasRawPointerFlag : 0U) |
216-
(isMoveOnly ? MoveOnlyFlag : 0U)) {}
207+
(hasRawPointer ? HasRawPointerFlag : 0U)) {}
217208

218209
constexpr bool operator==(RecursiveProperties p) const {
219210
return Flags == p.Flags;
@@ -240,36 +231,6 @@ class TypeLowering {
240231
return {IsTrivial, IsFixedABI, IsNotAddressOnly, IsResilient};
241232
}
242233

243-
static constexpr RecursiveProperties forMoveOnlyReference() {
244-
return {IsNotTrivial,
245-
IsFixedABI,
246-
IsNotAddressOnly,
247-
IsNotResilient,
248-
IsNotTypeExpansionSensitive,
249-
DoesNotHaveRawPointer,
250-
IsMoveOnly};
251-
}
252-
253-
static constexpr RecursiveProperties forMoveOnlyOpaque() {
254-
return {IsNotTrivial,
255-
IsNotFixedABI,
256-
IsAddressOnly,
257-
IsNotResilient,
258-
IsNotTypeExpansionSensitive,
259-
DoesNotHaveRawPointer,
260-
IsMoveOnly};
261-
}
262-
263-
static constexpr RecursiveProperties forMoveOnlyResilient() {
264-
return {IsTrivial,
265-
IsFixedABI,
266-
IsNotAddressOnly,
267-
IsResilient,
268-
IsNotTypeExpansionSensitive,
269-
DoesNotHaveRawPointer,
270-
IsMoveOnly};
271-
}
272-
273234
void addSubobject(RecursiveProperties other) {
274235
Flags |= other.Flags;
275236
}
@@ -296,9 +257,6 @@ class TypeLowering {
296257
IsInfiniteType_t isInfinite() const {
297258
return IsInfiniteType_t((Flags & InfiniteFlag) != 0);
298259
}
299-
IsMoveOnly_t isMoveOnlyWrapped() const {
300-
return IsMoveOnly_t((Flags & MoveOnlyFlag) != 0);
301-
}
302260

303261
void setNonTrivial() { Flags |= NonTrivialFlag; }
304262
void setNonFixedABI() { Flags |= NonFixedABIFlag; }
@@ -309,7 +267,6 @@ class TypeLowering {
309267
(isTypeExpansionSensitive ? TypeExpansionSensitiveFlag : 0);
310268
}
311269
void setInfinite() { Flags |= InfiniteFlag; }
312-
void setMoveOnly() { Flags |= MoveOnlyFlag; }
313270
};
314271

315272
private:

lib/SIL/IR/TypeLowering.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -244,24 +244,12 @@ namespace {
244244
RecursiveProperties::forReference());
245245
}
246246

247-
RecursiveProperties getMoveOnlyReferenceRecursiveProperties(
248-
IsTypeExpansionSensitive_t isSensitive) {
249-
return mergeIsTypeExpansionSensitive(isSensitive,
250-
RecursiveProperties::forReference());
251-
}
252-
253247
RecursiveProperties
254248
getOpaqueRecursiveProperties(IsTypeExpansionSensitive_t isSensitive) {
255249
return mergeIsTypeExpansionSensitive(isSensitive,
256250
RecursiveProperties::forOpaque());
257251
}
258252

259-
RecursiveProperties getMoveOnlyOpaqueRecursiveProperties(
260-
IsTypeExpansionSensitive_t isSensitive) {
261-
return mergeIsTypeExpansionSensitive(
262-
isSensitive, RecursiveProperties::forMoveOnlyOpaque());
263-
}
264-
265253
#define IMPL(TYPE, LOWERING) \
266254
RetTy visit##TYPE##Type(Can##TYPE##Type type, AbstractionPattern orig, \
267255
IsTypeExpansionSensitive_t isSensitive) { \
@@ -704,12 +692,12 @@ namespace {
704692
if (lowering.isAddressOnly()) {
705693
return asImpl().handleMoveOnlyAddressOnly(
706694
type->getCanonicalType(),
707-
getMoveOnlyOpaqueRecursiveProperties(isSensitive));
695+
getOpaqueRecursiveProperties(isSensitive));
708696
}
709697

710698
return asImpl().handleMoveOnlyReference(
711699
type->getCanonicalType(),
712-
getMoveOnlyReferenceRecursiveProperties(isSensitive));
700+
getReferenceRecursiveProperties(isSensitive));
713701
}
714702

715703
RetTy handleAggregateByProperties(CanType type, RecursiveProperties props) {

0 commit comments

Comments
 (0)