@@ -1169,7 +1169,7 @@ final public class BridgeObjectToRefInst : SingleValueInstruction, UnaryInstruct
11691169
11701170final public class BridgeObjectToWordInst : SingleValueInstruction , UnaryInstruction { }
11711171
1172- final public class BorrowedFromInst : SingleValueInstruction , BorrowIntroducingInstruction {
1172+ final public class BorrowedFromInst : SingleValueInstruction , BeginBorrowInstruction {
11731173 public var borrowedValue : Value { operands [ 0 ] . value }
11741174 public var borrowedPhi : Phi { Phi ( borrowedValue) ! }
11751175 public var enclosingOperands : OperandArray {
@@ -1431,21 +1431,22 @@ extension Instruction {
14311431 }
14321432}
14331433
1434- /// Instructions beginning a borrow-scope which must be ended by `end_borrow`.
1435- public protocol BorrowIntroducingInstruction : SingleValueInstruction , ScopedInstruction {
1434+ /// Single-value instructions beginning a borrow-scope which end with an `end_borrow` or a branch to a re-borrow phi.
1435+ /// See also `BeginBorrowValue` which represents all kind of `Value`s which begin a borrow scope.
1436+ public protocol BeginBorrowInstruction : SingleValueInstruction , ScopedInstruction {
14361437}
14371438
14381439final public class EndBorrowInst : Instruction , UnaryInstruction {
14391440 public var borrow : Value { operand. value }
14401441}
14411442
1442- extension BorrowIntroducingInstruction {
1443+ extension BeginBorrowInstruction {
14431444 public var endOperands : LazyFilterSequence < UseList > {
14441445 return self . uses. lazy. filter { $0. instruction is EndBorrowInst }
14451446 }
14461447}
14471448
1448- final public class BeginBorrowInst : SingleValueInstruction , UnaryInstruction , BorrowIntroducingInstruction {
1449+ final public class BeginBorrowInst : SingleValueInstruction , UnaryInstruction , BeginBorrowInstruction {
14491450 public var borrowedValue : Value { operand. value }
14501451
14511452 public override var isLexical : Bool { bridged. BeginBorrow_isLexical ( ) }
@@ -1457,7 +1458,7 @@ final public class BeginBorrowInst : SingleValueInstruction, UnaryInstruction, B
14571458 }
14581459}
14591460
1460- final public class LoadBorrowInst : SingleValueInstruction , LoadInstruction , BorrowIntroducingInstruction {
1461+ final public class LoadBorrowInst : SingleValueInstruction , LoadInstruction , BeginBorrowInstruction {
14611462
14621463 // True if the invariants on `load_borrow` have not been checked and should not be strictly enforced.
14631464 //
@@ -1467,7 +1468,7 @@ final public class LoadBorrowInst : SingleValueInstruction, LoadInstruction, Bor
14671468 public var isUnchecked : Bool { bridged. LoadBorrowInst_isUnchecked ( ) }
14681469}
14691470
1470- final public class StoreBorrowInst : SingleValueInstruction , StoringInstruction , BorrowIntroducingInstruction {
1471+ final public class StoreBorrowInst : SingleValueInstruction , StoringInstruction , BeginBorrowInstruction {
14711472 public var allocStack : AllocStackInst {
14721473 var dest = destination
14731474 if let mark = dest as? MarkUnresolvedNonCopyableValueInst {
0 commit comments