@@ -48,7 +48,8 @@ public class Instruction : CustomStringConvertible, Hashable {
48
48
return OperandArray ( base: operands. base, count: operands. count)
49
49
}
50
50
51
- // All operands defined by the operation. Returns the prefix of `operands` that does not include trailing type dependent operands.
51
+ // All operands defined by the operation.
52
+ // Returns the prefix of `operands` that does not include trailing type dependent operands.
52
53
final public var definedOperands : OperandArray {
53
54
let operands = bridged. getOperands ( )
54
55
let typeOperands = bridged. getTypeDependentOperands ( )
@@ -237,7 +238,7 @@ public class MultipleValueInstruction : Instruction {
237
238
}
238
239
}
239
240
240
- /// Instructions, which have a single operand.
241
+ /// Instructions, which have a single operand (not including type-dependent operands) .
241
242
public protocol UnaryInstruction : Instruction {
242
243
var operand : Operand { get }
243
244
}
@@ -311,14 +312,13 @@ public protocol SourceDestAddrInstruction : Instruction {
311
312
}
312
313
313
314
extension SourceDestAddrInstruction {
314
- public var sourceOperand : Operand { return operands [ 0 ] }
315
- public var destinationOperand : Operand { return operands [ 1 ] }
315
+ public var sourceOperand : Operand { operands [ 0 ] }
316
+ public var destinationOperand : Operand { operands [ 1 ] }
317
+ public var source : Value { sourceOperand. value }
318
+ public var destination : Value { destinationOperand. value }
316
319
}
317
320
318
321
final public class CopyAddrInst : Instruction , SourceDestAddrInstruction {
319
- public var source : Value { return sourceOperand. value }
320
- public var destination : Value { return destinationOperand. value }
321
-
322
322
public var isTakeOfSrc : Bool {
323
323
bridged. CopyAddrInst_isTakeOfSrc ( )
324
324
}
@@ -681,7 +681,7 @@ final public
681
681
class InitExistentialAddrInst : SingleValueInstruction , UnaryInstruction { }
682
682
683
683
final public
684
- class DeinitExistentialAddrInst : Instruction { }
684
+ class DeinitExistentialAddrInst : Instruction , UnaryInstruction { }
685
685
686
686
final public
687
687
class DeinitExistentialValueInst : Instruction { }
@@ -873,6 +873,8 @@ final public class RefElementAddrInst : SingleValueInstruction, UnaryInstruction
873
873
874
874
final public class RefTailAddrInst : SingleValueInstruction , UnaryInstruction {
875
875
public var instance : Value { operand. value }
876
+
877
+ public var isImmutable : Bool { bridged. RefTailAddrInst_isImmutable ( ) }
876
878
}
877
879
878
880
final public class KeyPathInst : SingleValueInstruction {
@@ -1219,7 +1221,9 @@ extension Instruction {
1219
1221
/// Instructions beginning a borrow-scope which must be ended by `end_borrow`.
1220
1222
public protocol BorrowIntroducingInstruction : SingleValueInstruction , ScopedInstruction { }
1221
1223
1222
- final public class EndBorrowInst : Instruction , UnaryInstruction { }
1224
+ final public class EndBorrowInst : Instruction , UnaryInstruction {
1225
+ public var borrow : Value { operand. value }
1226
+ }
1223
1227
1224
1228
extension BorrowIntroducingInstruction {
1225
1229
public var endOperands : LazyFilterSequence < UseList > {
@@ -1264,6 +1268,7 @@ final public class BeginAccessInst : SingleValueInstruction, UnaryInstruction {
1264
1268
}
1265
1269
1266
1270
public var isStatic : Bool { bridged. BeginAccessInst_isStatic ( ) }
1271
+ public var isUnsafe : Bool { bridged. BeginAccessInst_isUnsafe ( ) }
1267
1272
1268
1273
public var address : Value { operand. value }
1269
1274
@@ -1304,8 +1309,15 @@ final public class BeginApplyInst : MultipleValueInstruction, FullApplySite {
1304
1309
}
1305
1310
}
1306
1311
1307
- final public class EndApplyInst : Instruction , UnaryInstruction { }
1308
- final public class AbortApplyInst : Instruction , UnaryInstruction { }
1312
+ final public class EndApplyInst : Instruction , UnaryInstruction {
1313
+ public var token : MultipleValueInstructionResult { operand. value as! MultipleValueInstructionResult }
1314
+ public var beginApply : BeginApplyInst { token. parentInstruction as! BeginApplyInst }
1315
+ }
1316
+
1317
+ final public class AbortApplyInst : Instruction , UnaryInstruction {
1318
+ public var token : MultipleValueInstructionResult { operand. value as! MultipleValueInstructionResult }
1319
+ public var beginApply : BeginApplyInst { token. parentInstruction as! BeginApplyInst }
1320
+ }
1309
1321
1310
1322
extension BeginApplyInst : ScopedInstruction {
1311
1323
public var endOperands : LazyFilterSequence < UseList > {
0 commit comments