@@ -254,6 +254,7 @@ extension UnaryInstruction {
254
254
final public class UnimplementedInstruction : Instruction {
255
255
}
256
256
257
+ /// Only one of the operands may have an address type.
257
258
public protocol StoringInstruction : Instruction {
258
259
var operands : OperandArray { get }
259
260
}
@@ -303,14 +304,16 @@ final public class AssignInst : Instruction, StoringInstruction {
303
304
}
304
305
}
305
306
306
- final public class AssignByWrapperInst : Instruction { }
307
+ final public class AssignByWrapperInst : Instruction , StoringInstruction { }
307
308
308
- final public class AssignOrInitInst : Instruction { }
309
+ final public class AssignOrInitInst : Instruction , StoringInstruction { }
309
310
310
311
/// Instruction that copy or move from a source to destination address.
311
312
public protocol SourceDestAddrInstruction : Instruction {
312
313
var sourceOperand : Operand { get }
313
314
var destinationOperand : Operand { get }
315
+ var isTakeOfSrc : Bool { get }
316
+ var isInitializationOfDest : Bool { get }
314
317
}
315
318
316
319
extension SourceDestAddrInstruction {
@@ -333,6 +336,13 @@ final public class CopyAddrInst : Instruction, SourceDestAddrInstruction {
333
336
final public class ExplicitCopyAddrInst : Instruction , SourceDestAddrInstruction {
334
337
public var source : Value { return sourceOperand. value }
335
338
public var destination : Value { return destinationOperand. value }
339
+
340
+ public var isTakeOfSrc : Bool {
341
+ bridged. ExplicitCopyAddrInst_isTakeOfSrc ( )
342
+ }
343
+ public var isInitializationOfDest : Bool {
344
+ bridged. ExplicitCopyAddrInst_isInitializationOfDest ( )
345
+ }
336
346
}
337
347
338
348
final public class EndAccessInst : Instruction , UnaryInstruction {
@@ -590,7 +600,10 @@ class UncheckedRefCastInst : SingleValueInstruction, ConversionInstruction {
590
600
}
591
601
592
602
final public
593
- class UncheckedRefCastAddrInst : Instruction , SourceDestAddrInstruction { }
603
+ class UncheckedRefCastAddrInst : Instruction , SourceDestAddrInstruction {
604
+ public var isTakeOfSrc : Bool { true }
605
+ public var isInitializationOfDest : Bool { true }
606
+ }
594
607
595
608
final public class UncheckedAddrCastInst : SingleValueInstruction , UnaryInstruction {
596
609
public var fromAddress : Value { operand. value }
@@ -777,7 +790,9 @@ class TupleElementAddrInst : SingleValueInstruction, UnaryInstruction {
777
790
public var fieldIndex : Int { bridged. TupleElementAddrInst_fieldIndex ( ) }
778
791
}
779
792
780
- final public class TupleAddrConstructorInst : Instruction { }
793
+ final public class TupleAddrConstructorInst : Instruction {
794
+ public var destinationOperand : Operand { operands [ 0 ] }
795
+ }
781
796
782
797
final public class StructInst : SingleValueInstruction , ForwardingInstruction {
783
798
}
@@ -1027,7 +1042,10 @@ final public class IsEscapingClosureInst : SingleValueInstruction, UnaryInstruct
1027
1042
final public
1028
1043
class MarkUnresolvedNonCopyableValueInst : SingleValueInstruction , UnaryInstruction { }
1029
1044
1030
- final public class MarkUnresolvedMoveAddrInst : Instruction , SourceDestAddrInstruction { }
1045
+ final public class MarkUnresolvedMoveAddrInst : Instruction , SourceDestAddrInstruction {
1046
+ public var isTakeOfSrc : Bool { true }
1047
+ public var isInitializationOfDest : Bool { true }
1048
+ }
1031
1049
1032
1050
final public
1033
1051
class CopyableToMoveOnlyWrapperAddrInst : SingleValueInstruction , UnaryInstruction { }
0 commit comments