Skip to content

Commit 45b7195

Browse files
committed
Update how MarkMustCheckInst and MarkUnresolvedReferenceBindingInst inherit
1 parent 0e27cd1 commit 45b7195

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

include/swift/SIL/SILInstruction.h

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8285,8 +8285,7 @@ class MarkUnresolvedMoveAddrInst
82858285
/// checking by the checkers that rely upon this instruction.
82868286
class MarkMustCheckInst
82878287
: public UnaryInstructionBase<SILInstructionKind::MarkMustCheckInst,
8288-
SingleValueInstruction>,
8289-
public ForwardingInstruction {
8288+
OwnershipForwardingSingleValueInstruction> {
82908289
friend class SILBuilder;
82918290

82928291
public:
@@ -8325,9 +8324,8 @@ class MarkMustCheckInst
83258324

83268325
MarkMustCheckInst(SILDebugLocation DebugLoc, SILValue operand,
83278326
CheckKind checkKind)
8328-
: UnaryInstructionBase(DebugLoc, operand, operand->getType()),
8329-
ForwardingInstruction(SILInstructionKind::MarkMustCheckInst,
8330-
operand->getOwnershipKind()),
8327+
: UnaryInstructionBase(DebugLoc, operand, operand->getType(),
8328+
operand->getOwnershipKind()),
83318329
kind(checkKind) {
83328330
assert(operand->getType().isMoveOnly() &&
83338331
"mark_must_check can only take a move only typed value");
@@ -8356,8 +8354,7 @@ class MarkMustCheckInst
83568354
class MarkUnresolvedReferenceBindingInst
83578355
: public UnaryInstructionBase<
83588356
SILInstructionKind::MarkUnresolvedReferenceBindingInst,
8359-
SingleValueInstruction>,
8360-
public ForwardingInstruction {
8357+
OwnershipForwardingSingleValueInstruction> {
83618358
friend class SILBuilder;
83628359

83638360
public:
@@ -8372,10 +8369,8 @@ class MarkUnresolvedReferenceBindingInst
83728369

83738370
MarkUnresolvedReferenceBindingInst(SILDebugLocation debugLoc,
83748371
SILValue operand, Kind kind)
8375-
: UnaryInstructionBase(debugLoc, operand, operand->getType()),
8376-
ForwardingInstruction(
8377-
SILInstructionKind::MarkUnresolvedReferenceBindingInst,
8378-
operand->getOwnershipKind()),
8372+
: UnaryInstructionBase(debugLoc, operand, operand->getType(),
8373+
operand->getOwnershipKind()),
83798374
kind(kind) {}
83808375

83818376
public:
@@ -10819,9 +10814,7 @@ inline bool ForwardingInstruction::isa(SILInstructionKind kind) {
1081910814
OwnershipForwardingTermInst::classof(kind) ||
1082010815
OwnershipForwardingConversionInst::classof(kind) ||
1082110816
OwnershipForwardingSelectEnumInstBase::classof(kind) ||
10822-
OwnershipForwardingMultipleValueInstruction::classof(kind) ||
10823-
kind == SILInstructionKind::MarkMustCheckInst ||
10824-
kind == SILInstructionKind::MarkUnresolvedReferenceBindingInst;
10817+
OwnershipForwardingMultipleValueInstruction::classof(kind);
1082510818
}
1082610819

1082710820
inline ForwardingInstruction *ForwardingInstruction::get(SILInstruction *inst) {
@@ -10840,10 +10833,6 @@ inline ForwardingInstruction *ForwardingInstruction::get(SILInstruction *inst) {
1084010833
if (auto *result =
1084110834
dyn_cast<OwnershipForwardingMultipleValueInstruction>(inst))
1084210835
return result;
10843-
if (auto *result = dyn_cast<MarkMustCheckInst>(inst))
10844-
return result;
10845-
if (auto *result = dyn_cast<MarkUnresolvedReferenceBindingInst>(inst))
10846-
return result;
1084710836
if (auto *result = dyn_cast<MoveOnlyWrapperToCopyableValueInst>(inst))
1084810837
return result;
1084910838
if (auto *result = dyn_cast<CopyableToMoveOnlyWrapperValueInst>(inst))

0 commit comments

Comments
 (0)