@@ -1169,7 +1169,7 @@ final public class BridgeObjectToRefInst : SingleValueInstruction, UnaryInstruct
1169
1169
1170
1170
final public class BridgeObjectToWordInst : SingleValueInstruction , UnaryInstruction { }
1171
1171
1172
- final public class BorrowedFromInst : SingleValueInstruction , BorrowIntroducingInstruction {
1172
+ final public class BorrowedFromInst : SingleValueInstruction , BeginBorrowInstruction {
1173
1173
public var borrowedValue : Value { operands [ 0 ] . value }
1174
1174
public var borrowedPhi : Phi { Phi ( borrowedValue) ! }
1175
1175
public var enclosingOperands : OperandArray {
@@ -1431,21 +1431,22 @@ extension Instruction {
1431
1431
}
1432
1432
}
1433
1433
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 {
1436
1437
}
1437
1438
1438
1439
final public class EndBorrowInst : Instruction , UnaryInstruction {
1439
1440
public var borrow : Value { operand. value }
1440
1441
}
1441
1442
1442
- extension BorrowIntroducingInstruction {
1443
+ extension BeginBorrowInstruction {
1443
1444
public var endOperands : LazyFilterSequence < UseList > {
1444
1445
return self . uses. lazy. filter { $0. instruction is EndBorrowInst }
1445
1446
}
1446
1447
}
1447
1448
1448
- final public class BeginBorrowInst : SingleValueInstruction , UnaryInstruction , BorrowIntroducingInstruction {
1449
+ final public class BeginBorrowInst : SingleValueInstruction , UnaryInstruction , BeginBorrowInstruction {
1449
1450
public var borrowedValue : Value { operand. value }
1450
1451
1451
1452
public override var isLexical : Bool { bridged. BeginBorrow_isLexical ( ) }
@@ -1457,7 +1458,7 @@ final public class BeginBorrowInst : SingleValueInstruction, UnaryInstruction, B
1457
1458
}
1458
1459
}
1459
1460
1460
- final public class LoadBorrowInst : SingleValueInstruction , LoadInstruction , BorrowIntroducingInstruction {
1461
+ final public class LoadBorrowInst : SingleValueInstruction , LoadInstruction , BeginBorrowInstruction {
1461
1462
1462
1463
// True if the invariants on `load_borrow` have not been checked and should not be strictly enforced.
1463
1464
//
@@ -1467,7 +1468,7 @@ final public class LoadBorrowInst : SingleValueInstruction, LoadInstruction, Bor
1467
1468
public var isUnchecked : Bool { bridged. LoadBorrowInst_isUnchecked ( ) }
1468
1469
}
1469
1470
1470
- final public class StoreBorrowInst : SingleValueInstruction , StoringInstruction , BorrowIntroducingInstruction {
1471
+ final public class StoreBorrowInst : SingleValueInstruction , StoringInstruction , BeginBorrowInstruction {
1471
1472
public var allocStack : AllocStackInst {
1472
1473
var dest = destination
1473
1474
if let mark = dest as? MarkUnresolvedNonCopyableValueInst {
0 commit comments