Skip to content

Commit 0b81392

Browse files
committed
Code formatting cleanup related to ForwardingInstruction.
1 parent 5fc50a0 commit 0b81392

File tree

2 files changed

+16
-22
lines changed

2 files changed

+16
-22
lines changed

SwiftCompilerSources/Sources/SIL/ForwardingInstruction.swift

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,6 @@ extension ForwardingInstruction {
5858
}
5959
}
6060

61-
// An instruction that forwards a single value to a single result.
62-
//
63-
// For legacy reasons, some ForwardingInstructions that fit the
64-
// SingleValueInstruction and UnaryInstruction requirements are not
65-
// considered ConversionInstructions because certain routines do not
66-
// want to see through them (InitExistentialValueInst,
67-
// DeinitExistentialValueInst, OpenExistentialValueInst,
68-
// OpenExistentialValueInst). This most likely has to do with
69-
// type-dependent operands, although any ConversionInstruction should
70-
// support type-dependent operands.
71-
public protocol ConversionInstruction : SingleValueInstruction,
72-
UnaryInstruction,
73-
ForwardingInstruction
74-
{}
75-
7661
extension Value {
7762
// If this value is produced by a ForwardingInstruction, return that instruction. This is convenient for following the forwarded value chain.
7863
// Unlike definingInstruction, a value's forwardingInstruction is not necessarily a valid insertion point.
@@ -232,6 +217,18 @@ extension TuplePackExtractInst : ForwardingInstruction {
232217
// -----------------------------------------------------------------------------
233218
// conversion instructions
234219

220+
/// An instruction that forwards a single value to a single result.
221+
///
222+
/// For legacy reasons, some ForwardingInstructions that fit the
223+
/// SingleValueInstruction and UnaryInstruction requirements are not
224+
/// considered ConversionInstructions because certain routines do not
225+
/// want to see through them (InitExistentialValueInst,
226+
/// DeinitExistentialValueInst, OpenExistentialValueInst,
227+
/// OpenExistentialValueInst). This most likely has to do with
228+
/// type-dependent operands, although any ConversionInstruction should
229+
/// support type-dependent operands.
230+
public protocol ConversionInstruction : SingleValueInstruction, UnaryInstruction, ForwardingInstruction {}
231+
235232
extension MarkUnresolvedNonCopyableValueInst : ConversionInstruction {
236233
public var preservesRepresentation: Bool { true }
237234
public var canForwardGuaranteedValues: Bool { true }

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,8 +1115,7 @@ final public class IsUniqueInst : SingleValueInstruction, UnaryInstruction {}
11151115

11161116
final public class IsEscapingClosureInst : SingleValueInstruction, UnaryInstruction {}
11171117

1118-
final public class MarkUnresolvedNonCopyableValueInst
1119-
: SingleValueInstruction, UnaryInstruction {}
1118+
final public class MarkUnresolvedNonCopyableValueInst: SingleValueInstruction, UnaryInstruction {}
11201119

11211120
final public class MarkUnresolvedReferenceBindingInst : SingleValueInstruction {}
11221121

@@ -1125,13 +1124,11 @@ final public class MarkUnresolvedMoveAddrInst : Instruction, SourceDestAddrInstr
11251124
public var isInitializationOfDest: Bool { true }
11261125
}
11271126

1128-
final public class CopyableToMoveOnlyWrapperValueInst
1129-
: SingleValueInstruction, UnaryInstruction {}
1127+
final public class CopyableToMoveOnlyWrapperValueInst: SingleValueInstruction, UnaryInstruction {}
11301128

1131-
final public class MoveOnlyWrapperToCopyableValueInst
1132-
: SingleValueInstruction, UnaryInstruction {}
1129+
final public class MoveOnlyWrapperToCopyableValueInst: SingleValueInstruction, UnaryInstruction {}
11331130

1134-
final public class MoveOnlyWrapperToCopyableBoxInst : SingleValueInstruction {}
1131+
final public class MoveOnlyWrapperToCopyableBoxInst: SingleValueInstruction, UnaryInstruction {}
11351132

11361133
final public class CopyableToMoveOnlyWrapperAddrInst
11371134
: SingleValueInstruction, UnaryInstruction {}

0 commit comments

Comments
 (0)