@@ -63,15 +63,16 @@ static inline llvm::hash_code hash_value(ValueKind K) {
63
63
// / What constraint does the given use of an SSA value put on the lifetime of
64
64
// / the given SSA value.
65
65
// /
66
- // / There are two possible constraints: MustBeLive and
67
- // / MustBeInvalidated. MustBeLive means that the SSA value must be able to be
68
- // / used in a valid way at the given use point. MustBeInvalidated means that any
69
- // / use of given SSA value after this instruction on any path through this
70
- // / instruction.
66
+ // / There are two possible constraints: NonLifetimeEnding and
67
+ // / LifetimeEnding. NonLifetimeEnding means that the SSA value must be
68
+ // / able to be used in a valid way at the given use
69
+ // / point. LifetimeEnding means that the value has been invalidated at
70
+ // / the given use point and any uses reachable from that point are
71
+ // / invalid in SIL causing a SIL verifier error.
71
72
enum class UseLifetimeConstraint {
72
73
// / This use requires the SSA value to be live after the given instruction's
73
74
// / execution.
74
- MustBeLive ,
75
+ NonLifetimeEnding ,
75
76
76
77
// / This use invalidates the given SSA value.
77
78
// /
@@ -81,7 +82,7 @@ enum class UseLifetimeConstraint {
81
82
// / guaranteed (i.e. shared borrow) semantics this means that the program
82
83
// / has left the scope of the borrowed SSA value and said value can not be
83
84
// / used.
84
- MustBeInvalidated ,
85
+ LifetimeEnding ,
85
86
};
86
87
87
88
llvm::raw_ostream &operator <<(llvm::raw_ostream &os,
@@ -174,9 +175,9 @@ struct ValueOwnershipKind {
174
175
case ValueOwnershipKind::None:
175
176
case ValueOwnershipKind::Guaranteed:
176
177
case ValueOwnershipKind::Unowned:
177
- return UseLifetimeConstraint::MustBeLive ;
178
+ return UseLifetimeConstraint::NonLifetimeEnding ;
178
179
case ValueOwnershipKind::Owned:
179
- return UseLifetimeConstraint::MustBeInvalidated ;
180
+ return UseLifetimeConstraint::LifetimeEnding ;
180
181
}
181
182
llvm_unreachable (" covered switch" );
182
183
}
@@ -523,7 +524,8 @@ struct OperandOwnershipKindMap {
523
524
if (ValueOwnershipKind (index) == kind) {
524
525
continue ;
525
526
}
526
- map.add (ValueOwnershipKind (index), UseLifetimeConstraint::MustBeLive);
527
+ map.add (ValueOwnershipKind (index),
528
+ UseLifetimeConstraint::NonLifetimeEnding);
527
529
}
528
530
return map;
529
531
}
@@ -548,7 +550,8 @@ struct OperandOwnershipKindMap {
548
550
unsigned index = 0 ;
549
551
unsigned end = unsigned (ValueOwnershipKind::LastValueOwnershipKind) + 1 ;
550
552
while (index != end) {
551
- map.add (ValueOwnershipKind (index), UseLifetimeConstraint::MustBeLive);
553
+ map.add (ValueOwnershipKind (index),
554
+ UseLifetimeConstraint::NonLifetimeEnding);
552
555
++index;
553
556
}
554
557
return map;
@@ -574,7 +577,7 @@ struct OperandOwnershipKindMap {
574
577
575
578
void addCompatibilityConstraint (ValueOwnershipKind kind,
576
579
UseLifetimeConstraint constraint) {
577
- add (ValueOwnershipKind::None, UseLifetimeConstraint::MustBeLive );
580
+ add (ValueOwnershipKind::None, UseLifetimeConstraint::NonLifetimeEnding );
578
581
add (kind, constraint);
579
582
}
580
583
@@ -704,7 +707,7 @@ class Operand {
704
707
return false ;
705
708
auto map = getOwnershipKindMap ();
706
709
auto constraint = map.getLifetimeConstraint (get ().getOwnershipKind ());
707
- return constraint == UseLifetimeConstraint::MustBeInvalidated ;
710
+ return constraint == UseLifetimeConstraint::LifetimeEnding ;
708
711
}
709
712
710
713
SILBasicBlock *getParentBlock () const ;
0 commit comments