@@ -44,25 +44,25 @@ struct Region {
44
44
45
45
using namespace PartitionPrimitives ;
46
46
47
- // PartitionOpKind represents the different kinds of PartitionOps that
48
- // SILInstructions can be translated to
47
+ // / PartitionOpKind represents the different kinds of PartitionOps that
48
+ // / SILInstructions can be translated to
49
49
enum class PartitionOpKind : uint8_t {
50
- // Assign one value to the region of another, takes two args, second arg
51
- // must already be tracked with a non-consumed region
50
+ // / Assign one value to the region of another, takes two args, second arg
51
+ // / must already be tracked with a non-consumed region
52
52
Assign,
53
53
54
- // Assign one value to a fresh region, takes one arg.
54
+ // / Assign one value to a fresh region, takes one arg.
55
55
AssignFresh,
56
56
57
- // Consume the region of a value if not already consumed, takes one arg.
58
- Consume,
59
-
60
- // Merge the regions of two values, takes two args, both must be from
61
- // non-consumed regions.
57
+ // / Merge the regions of two values, takes two args, both must be from
58
+ // / non-consumed regions.
62
59
Merge,
63
60
64
- // Require the region of a value to be non-consumed, takes one arg.
65
- Require
61
+ // / Consume the region of a value if not already consumed, takes one arg.
62
+ Transfer,
63
+
64
+ // / Require the region of a value to be non-consumed, takes one arg.
65
+ Require,
66
66
};
67
67
68
68
// PartitionOp represents a primitive operation that can be performed on
@@ -108,11 +108,9 @@ class PartitionOp {
108
108
return PartitionOp (PartitionOpKind::AssignFresh, tgt, sourceInst);
109
109
}
110
110
111
- static PartitionOp Consume (Element tgt,
112
- SILInstruction *sourceInst = nullptr ,
113
- Expr *sourceExpr = nullptr ) {
114
- return PartitionOp (PartitionOpKind::Consume, tgt,
115
- sourceInst, sourceExpr);
111
+ static PartitionOp Transfer (Element tgt, SILInstruction *sourceInst = nullptr ,
112
+ Expr *sourceExpr = nullptr ) {
113
+ return PartitionOp (PartitionOpKind::Transfer, tgt, sourceInst, sourceExpr);
116
114
}
117
115
118
116
static PartitionOp Merge (Element tgt1, Element tgt2,
@@ -164,7 +162,7 @@ class PartitionOp {
164
162
case PartitionOpKind::AssignFresh:
165
163
os << " assign_fresh %%" << OpArgs[0 ] << " \n " ;
166
164
break ;
167
- case PartitionOpKind::Consume :
165
+ case PartitionOpKind::Transfer :
168
166
os << " consume %%" << OpArgs[0 ] << " \n " ;
169
167
break ;
170
168
case PartitionOpKind::Merge:
@@ -425,7 +423,7 @@ class Partition {
425
423
fresh_label = Region (fresh_label + 1 );
426
424
canonical = false ;
427
425
break ;
428
- case PartitionOpKind::Consume :
426
+ case PartitionOpKind::Transfer :
429
427
assert (op.OpArgs .size () == 1 &&
430
428
" Consume PartitionOp should be passed 1 argument" );
431
429
assert (labels.count (op.OpArgs [0 ]) &&
0 commit comments