@@ -234,7 +234,7 @@ extension UnaryInstruction {
234
234
final public class UnimplementedInstruction : Instruction {
235
235
}
236
236
237
- public protocol StoringInstruction : AnyObject {
237
+ public protocol StoringInstruction : Instruction {
238
238
var operands : OperandArray { get }
239
239
}
240
240
@@ -270,6 +270,8 @@ final public class StoreInst : Instruction, StoringInstruction {
270
270
final public class StoreWeakInst : Instruction , StoringInstruction { }
271
271
final public class StoreUnownedInst : Instruction , StoringInstruction { }
272
272
273
+ final public class StoreBorrowInst : SingleValueInstruction , StoringInstruction , BorrowIntroducingInstruction { }
274
+
273
275
final public class AssignInst : Instruction , StoringInstruction {
274
276
// must match with enum class swift::AssignOwnershipQualifier
275
277
public enum AssignOwnership : Int {
@@ -495,6 +497,9 @@ extension LoadInstruction {
495
497
public var address : Value { operand. value }
496
498
}
497
499
500
+ /// Instructions, beginning a borrow-scope which must be ended by `end_borrow`.
501
+ public protocol BorrowIntroducingInstruction : SingleValueInstruction { }
502
+
498
503
final public class LoadInst : SingleValueInstruction , LoadInstruction {
499
504
// must match with enum class LoadOwnershipQualifier
500
505
public enum LoadOwnership : Int {
@@ -507,7 +512,7 @@ final public class LoadInst : SingleValueInstruction, LoadInstruction {
507
512
508
513
final public class LoadWeakInst : SingleValueInstruction , LoadInstruction { }
509
514
final public class LoadUnownedInst : SingleValueInstruction , LoadInstruction { }
510
- final public class LoadBorrowInst : SingleValueInstruction , LoadInstruction { }
515
+ final public class LoadBorrowInst : SingleValueInstruction , LoadInstruction , BorrowIntroducingInstruction { }
511
516
512
517
final public class BuiltinInst : SingleValueInstruction {
513
518
public typealias ID = BridgedInstruction . BuiltinValueKind
@@ -872,7 +877,7 @@ extension BeginAccessInst : ScopedInstruction {
872
877
}
873
878
}
874
879
875
- final public class BeginBorrowInst : SingleValueInstruction , UnaryInstruction {
880
+ final public class BeginBorrowInst : SingleValueInstruction , UnaryInstruction , BorrowIntroducingInstruction {
876
881
public var borrowedValue : Value { operand. value }
877
882
878
883
public typealias EndBorrowSequence = LazyMapSequence < LazyFilterSequence < LazyMapSequence < UseList , EndBorrowInst ? > > ,
0 commit comments