@@ -1333,6 +1333,8 @@ final public class AllocExistentialBoxInst : SingleValueInstruction, Allocation
1333
1333
/// scope ending instruction such as `begin_access` (ending with `end_access`) and `begin_borrow` (ending with
1334
1334
/// `end_borrow`).
1335
1335
public protocol ScopedInstruction {
1336
+ var instruction : Instruction { get }
1337
+
1336
1338
var endOperands : LazyFilterSequence < UseList > { get }
1337
1339
1338
1340
var endInstructions : EndInstructions { get }
@@ -1349,7 +1351,12 @@ extension Instruction {
1349
1351
}
1350
1352
1351
1353
/// Instructions beginning a borrow-scope which must be ended by `end_borrow`.
1352
- public protocol BorrowIntroducingInstruction : SingleValueInstruction , ScopedInstruction { }
1354
+ public protocol BorrowIntroducingInstruction : SingleValueInstruction , ScopedInstruction {
1355
+ }
1356
+
1357
+ extension BorrowIntroducingInstruction {
1358
+ public var instruction : Instruction { get { self } }
1359
+ }
1353
1360
1354
1361
final public class EndBorrowInst : Instruction , UnaryInstruction {
1355
1362
public var borrow : Value { operand. value }
@@ -1428,6 +1435,8 @@ final public class EndAccessInst : Instruction, UnaryInstruction {
1428
1435
}
1429
1436
1430
1437
extension BeginAccessInst : ScopedInstruction {
1438
+ public var instruction : Instruction { get { self } }
1439
+
1431
1440
public var endOperands : LazyFilterSequence < UseList > {
1432
1441
return uses. lazy. filter { $0. instruction is EndAccessInst }
1433
1442
}
@@ -1462,6 +1471,8 @@ final public class AbortApplyInst : Instruction, UnaryInstruction {
1462
1471
}
1463
1472
1464
1473
extension BeginApplyInst : ScopedInstruction {
1474
+ public var instruction : Instruction { get { self } }
1475
+
1465
1476
public var endOperands : LazyFilterSequence < UseList > {
1466
1477
return token. uses. lazy. filter { $0. isScopeEndingUse }
1467
1478
}
0 commit comments