Skip to content

Commit c20142a

Browse files
committed
[NFC] Add ReturnInstruction protocol
1 parent 38c61d7 commit c20142a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,13 +1854,17 @@ public class TermInst : Instruction {
18541854
final public class UnreachableInst : TermInst {
18551855
}
18561856

1857-
final public class ReturnInst : TermInst, UnaryInstruction {
1857+
public protocol ReturnInstruction: TermInst {
1858+
var returnedValue: Value { get }
1859+
}
1860+
1861+
final public class ReturnInst : TermInst, UnaryInstruction, ReturnInstruction {
18581862
public var returnedValue: Value { operand.value }
18591863
public override var isFunctionExiting: Bool { true }
18601864
}
18611865

1862-
final public class ReturnBorrowInst : TermInst {
1863-
public var returnValue: Value { operands[0].value }
1866+
final public class ReturnBorrowInst : TermInst, ReturnInstruction {
1867+
public var returnedValue: Value { operands[0].value }
18641868
public var enclosingOperands: OperandArray {
18651869
let ops = operands
18661870
return ops[1..<ops.count]

0 commit comments

Comments
 (0)