@@ -1191,14 +1191,14 @@ class CopyLikeInstruction {
1191
1191
// /
1192
1192
// / NOTE: We assume that the constructor for the instruction subclass that
1193
1193
// / initializes the kind field on our object is run before our constructor runs.
1194
- class OwnershipForwardingMixin {
1194
+ class ForwardingInstruction {
1195
1195
ValueOwnershipKind ownershipKind;
1196
1196
bool preservesOwnershipFlag;
1197
1197
1198
1198
protected:
1199
- OwnershipForwardingMixin (SILInstructionKind kind,
1200
- ValueOwnershipKind ownershipKind,
1201
- bool preservesOwnership = true )
1199
+ ForwardingInstruction (SILInstructionKind kind,
1200
+ ValueOwnershipKind ownershipKind,
1201
+ bool preservesOwnership = true )
1202
1202
: ownershipKind(ownershipKind),
1203
1203
preservesOwnershipFlag (preservesOwnership) {
1204
1204
assert (isa (kind) && " Invalid subclass?!" );
@@ -1240,7 +1240,7 @@ class OwnershipForwardingMixin {
1240
1240
}
1241
1241
1242
1242
// / Defined inline below due to forward declaration issues.
1243
- static OwnershipForwardingMixin *get (SILInstruction *inst);
1243
+ static ForwardingInstruction *get (SILInstruction *inst);
1244
1244
// / Defined inline below due to forward declaration issues.
1245
1245
static bool isa (SILInstructionKind kind);
1246
1246
static bool isa (const SILInstruction *inst) { return isa (inst->getKind ()); }
@@ -1253,13 +1253,13 @@ class OwnershipForwardingMixin {
1253
1253
// / Return true if the forwarded value has the same representation. If true,
1254
1254
// / then the result can be mapped to the same storage without a move or copy.
1255
1255
// /
1256
- // / \p inst is an OwnershipForwardingMixin
1256
+ // / \p inst is an ForwardingInstruction
1257
1257
static bool hasSameRepresentation (SILInstruction *inst);
1258
1258
1259
1259
// / Return true if the forwarded value is address-only either before or after
1260
1260
// / forwarding.
1261
1261
// /
1262
- // / \p inst is an OwnershipForwardingMixin
1262
+ // / \p inst is an ForwardingInstruction
1263
1263
static bool isAddressOnly (SILInstruction *inst);
1264
1264
};
1265
1265
@@ -1272,14 +1272,14 @@ class OwnershipForwardingMixin {
1272
1272
// / operation that has no operand at all, like `enum .None`.
1273
1273
class FirstArgOwnershipForwardingSingleValueInst
1274
1274
: public SingleValueInstruction,
1275
- public OwnershipForwardingMixin {
1275
+ public ForwardingInstruction {
1276
1276
protected:
1277
1277
FirstArgOwnershipForwardingSingleValueInst (SILInstructionKind kind,
1278
1278
SILDebugLocation debugLoc,
1279
1279
SILType ty,
1280
1280
ValueOwnershipKind ownershipKind)
1281
1281
: SingleValueInstruction(kind, debugLoc, ty),
1282
- OwnershipForwardingMixin (kind, ownershipKind) {
1282
+ ForwardingInstruction (kind, ownershipKind) {
1283
1283
assert (classof (kind) && " classof missing new subclass?!" );
1284
1284
}
1285
1285
@@ -1404,16 +1404,15 @@ FirstArgOwnershipForwardingSingleValueInst::classof(SILInstructionKind kind) {
1404
1404
}
1405
1405
}
1406
1406
1407
- class AllArgOwnershipForwardingSingleValueInst
1408
- : public SingleValueInstruction,
1409
- public OwnershipForwardingMixin {
1407
+ class AllArgOwnershipForwardingSingleValueInst : public SingleValueInstruction ,
1408
+ public ForwardingInstruction {
1410
1409
protected:
1411
1410
AllArgOwnershipForwardingSingleValueInst (SILInstructionKind kind,
1412
1411
SILDebugLocation debugLoc,
1413
1412
SILType ty,
1414
1413
ValueOwnershipKind ownershipKind)
1415
1414
: SingleValueInstruction(kind, debugLoc, ty),
1416
- OwnershipForwardingMixin (kind, ownershipKind) {
1415
+ ForwardingInstruction (kind, ownershipKind) {
1417
1416
assert (classof (kind) && " classof missing new subclass?!" );
1418
1417
}
1419
1418
@@ -5549,13 +5548,13 @@ class ConversionInst : public SingleValueInstruction {
5549
5548
// /
5550
5549
// / The first operand is the ownership equivalent source.
5551
5550
class OwnershipForwardingConversionInst : public ConversionInst ,
5552
- public OwnershipForwardingMixin {
5551
+ public ForwardingInstruction {
5553
5552
protected:
5554
5553
OwnershipForwardingConversionInst (SILInstructionKind kind,
5555
5554
SILDebugLocation debugLoc, SILType ty,
5556
5555
ValueOwnershipKind ownershipKind)
5557
5556
: ConversionInst(kind, debugLoc, ty),
5558
- OwnershipForwardingMixin (kind, ownershipKind) {
5557
+ ForwardingInstruction (kind, ownershipKind) {
5559
5558
assert (classof (kind) && " classof missing subclass?!" );
5560
5559
}
5561
5560
@@ -6784,15 +6783,15 @@ class SelectEnumInstBase
6784
6783
6785
6784
// / A select enum inst that produces a static OwnershipKind.
6786
6785
class OwnershipForwardingSelectEnumInstBase : public SelectEnumInstBase ,
6787
- public OwnershipForwardingMixin {
6786
+ public ForwardingInstruction {
6788
6787
protected:
6789
6788
OwnershipForwardingSelectEnumInstBase (
6790
6789
SILInstructionKind kind, SILDebugLocation debugLoc, SILType type,
6791
6790
bool defaultValue, Optional<ArrayRef<ProfileCounter>> caseCounts,
6792
6791
ProfileCounter defaultCount, ValueOwnershipKind ownershipKind)
6793
6792
: SelectEnumInstBase(kind, debugLoc, type, defaultValue, caseCounts,
6794
6793
defaultCount),
6795
- OwnershipForwardingMixin (kind, ownershipKind) {
6794
+ ForwardingInstruction (kind, ownershipKind) {
6796
6795
assert (classof (kind) && " classof missing subclass" );
6797
6796
}
6798
6797
@@ -8413,7 +8412,7 @@ class MarkUnresolvedMoveAddrInst
8413
8412
class MarkMustCheckInst
8414
8413
: public UnaryInstructionBase<SILInstructionKind::MarkMustCheckInst,
8415
8414
SingleValueInstruction>,
8416
- public OwnershipForwardingMixin {
8415
+ public ForwardingInstruction {
8417
8416
friend class SILBuilder ;
8418
8417
8419
8418
public:
@@ -8453,8 +8452,8 @@ class MarkMustCheckInst
8453
8452
MarkMustCheckInst (SILDebugLocation DebugLoc, SILValue operand,
8454
8453
CheckKind checkKind)
8455
8454
: UnaryInstructionBase(DebugLoc, operand, operand->getType ()),
8456
- OwnershipForwardingMixin (SILInstructionKind::MarkMustCheckInst,
8457
- operand->getOwnershipKind ()),
8455
+ ForwardingInstruction (SILInstructionKind::MarkMustCheckInst,
8456
+ operand->getOwnershipKind ()),
8458
8457
kind(checkKind) {
8459
8458
assert (operand->getType ().isMoveOnly () &&
8460
8459
" mark_must_check can only take a move only typed value" );
@@ -8484,7 +8483,7 @@ class MarkUnresolvedReferenceBindingInst
8484
8483
: public UnaryInstructionBase<
8485
8484
SILInstructionKind::MarkUnresolvedReferenceBindingInst,
8486
8485
SingleValueInstruction>,
8487
- public OwnershipForwardingMixin {
8486
+ public ForwardingInstruction {
8488
8487
friend class SILBuilder ;
8489
8488
8490
8489
public:
@@ -8500,7 +8499,7 @@ class MarkUnresolvedReferenceBindingInst
8500
8499
MarkUnresolvedReferenceBindingInst (SILDebugLocation debugLoc,
8501
8500
SILValue operand, Kind kind)
8502
8501
: UnaryInstructionBase(debugLoc, operand, operand->getType ()),
8503
- OwnershipForwardingMixin (
8502
+ ForwardingInstruction (
8504
8503
SILInstructionKind::MarkUnresolvedReferenceBindingInst,
8505
8504
operand->getOwnershipKind ()),
8506
8505
kind(kind) {}
@@ -9271,14 +9270,14 @@ class TermInst : public NonValueInstruction {
9271
9270
9272
9271
// Forwards the first operand to a result in each successor block.
9273
9272
class OwnershipForwardingTermInst : public TermInst ,
9274
- public OwnershipForwardingMixin {
9273
+ public ForwardingInstruction {
9275
9274
protected:
9276
9275
OwnershipForwardingTermInst (SILInstructionKind kind,
9277
9276
SILDebugLocation debugLoc,
9278
9277
ValueOwnershipKind ownershipKind,
9279
9278
bool preservesOwnership = true )
9280
9279
: TermInst(kind, debugLoc),
9281
- OwnershipForwardingMixin (kind, ownershipKind, preservesOwnership) {
9280
+ ForwardingInstruction (kind, ownershipKind, preservesOwnership) {
9282
9281
assert (classof (kind));
9283
9282
}
9284
9283
@@ -10791,13 +10790,13 @@ SILFunction *ApplyInstBase<Impl, Base, false>::getCalleeFunction() const {
10791
10790
// / The first operand is the ownership equivalent source.
10792
10791
class OwnershipForwardingMultipleValueInstruction
10793
10792
: public MultipleValueInstruction,
10794
- public OwnershipForwardingMixin {
10793
+ public ForwardingInstruction {
10795
10794
public:
10796
10795
OwnershipForwardingMultipleValueInstruction (SILInstructionKind kind,
10797
10796
SILDebugLocation loc,
10798
10797
ValueOwnershipKind ownershipKind)
10799
10798
: MultipleValueInstruction(kind, loc),
10800
- OwnershipForwardingMixin (kind, ownershipKind) {
10799
+ ForwardingInstruction (kind, ownershipKind) {
10801
10800
assert (classof (kind) && " Missing subclass from classof?!" );
10802
10801
}
10803
10802
@@ -10941,7 +10940,7 @@ inline bool Operand::isTypeDependent() const {
10941
10940
return getUser ()->isTypeDependentOperand (*this );
10942
10941
}
10943
10942
10944
- inline bool OwnershipForwardingMixin ::isa (SILInstructionKind kind) {
10943
+ inline bool ForwardingInstruction ::isa (SILInstructionKind kind) {
10945
10944
return FirstArgOwnershipForwardingSingleValueInst::classof (kind) ||
10946
10945
AllArgOwnershipForwardingSingleValueInst::classof (kind) ||
10947
10946
OwnershipForwardingTermInst::classof (kind) ||
@@ -10952,12 +10951,11 @@ inline bool OwnershipForwardingMixin::isa(SILInstructionKind kind) {
10952
10951
kind == SILInstructionKind::MarkUnresolvedReferenceBindingInst;
10953
10952
}
10954
10953
10955
- inline OwnershipForwardingMixin *
10956
- OwnershipForwardingMixin::get (SILInstruction *inst) {
10954
+ inline ForwardingInstruction *ForwardingInstruction::get (SILInstruction *inst) {
10957
10955
// I am purposely performing this cast in this manner rather than reinterpret
10958
- // casting to OwnershipForwardingMixin to ensure that we offset to the
10956
+ // casting to ForwardingInstruction to ensure that we offset to the
10959
10957
// appropriate offset inside of inst instead of converting inst's current
10960
- // location to an OwnershipForwardingMixin which would be incorrect.
10958
+ // location to an ForwardingInstruction which would be incorrect.
10961
10959
if (auto *result = dyn_cast<FirstArgOwnershipForwardingSingleValueInst>(inst))
10962
10960
return result;
10963
10961
if (auto *result = dyn_cast<AllArgOwnershipForwardingSingleValueInst>(inst))
0 commit comments