@@ -307,9 +307,18 @@ final public class AssignByWrapperInst : Instruction {}
307
307
308
308
final public class AssignOrInitInst : Instruction { }
309
309
310
- final public class CopyAddrInst : Instruction {
310
+ /// Instruction that copy or move from a source to destination address.
311
+ public protocol SourceDestAddrInstruction : Instruction {
312
+ var sourceOperand : Operand { get }
313
+ var destinationOperand : Operand { get }
314
+ }
315
+
316
+ extension SourceDestAddrInstruction {
311
317
public var sourceOperand : Operand { return operands [ 0 ] }
312
318
public var destinationOperand : Operand { return operands [ 1 ] }
319
+ }
320
+
321
+ final public class CopyAddrInst : Instruction , SourceDestAddrInstruction {
313
322
public var source : Value { return sourceOperand. value }
314
323
public var destination : Value { return destinationOperand. value }
315
324
@@ -321,9 +330,7 @@ final public class CopyAddrInst : Instruction {
321
330
}
322
331
}
323
332
324
- final public class ExplicitCopyAddrInst : Instruction {
325
- public var sourceOperand : Operand { return operands [ 0 ] }
326
- public var destinationOperand : Operand { return operands [ 1 ] }
333
+ final public class ExplicitCopyAddrInst : Instruction , SourceDestAddrInstruction {
327
334
public var source : Value { return sourceOperand. value }
328
335
public var destination : Value { return destinationOperand. value }
329
336
}
@@ -583,7 +590,7 @@ class UncheckedRefCastInst : SingleValueInstruction, ConversionInstruction {
583
590
}
584
591
585
592
final public
586
- class UncheckedRefCastAddrInst : Instruction { }
593
+ class UncheckedRefCastAddrInst : Instruction , SourceDestAddrInstruction { }
587
594
588
595
final public class UncheckedAddrCastInst : SingleValueInstruction , UnaryInstruction {
589
596
public var fromAddress : Value { operand. value }
@@ -1020,8 +1027,7 @@ final public class IsEscapingClosureInst : SingleValueInstruction, UnaryInstruct
1020
1027
final public
1021
1028
class MarkUnresolvedNonCopyableValueInst : SingleValueInstruction , UnaryInstruction { }
1022
1029
1023
- final public
1024
- class MarkUnresolvedMoveAddrInst : Instruction { }
1030
+ final public class MarkUnresolvedMoveAddrInst : Instruction , SourceDestAddrInstruction { }
1025
1031
1026
1032
final public
1027
1033
class CopyableToMoveOnlyWrapperAddrInst : SingleValueInstruction , UnaryInstruction { }
0 commit comments