@@ -43,34 +43,42 @@ class OSSALifetimeCompletion {
43
43
enum HandleTrivialVariable_t { IgnoreTrivialVariable, ExtendTrivialVariable };
44
44
45
45
private:
46
- // If domInfo is nullptr, then InteriorLiveness never assumes dominance. As a
47
- // result it may report extra unenclosedPhis. In that case, any attempt to
48
- // create a new phi would result in an immediately redundant phi.
46
+ // / If domInfo is nullptr, then InteriorLiveness never assumes dominance. As a
47
+ // / result it may report extra unenclosedPhis. In that case, any attempt to
48
+ // / create a new phi would result in an immediately redundant phi.
49
49
const DominanceInfo *domInfo = nullptr ;
50
50
51
51
DeadEndBlocks &deadEndBlocks;
52
52
53
- // Cache intructions already handled by the recursive algorithm to avoid
54
- // recomputing their lifetimes.
53
+ // / Cache intructions already handled by the recursive algorithm to avoid
54
+ // / recomputing their lifetimes.
55
55
ValueSet completedValues;
56
56
57
- // Extend trivial variables for lifetime diagnostics (only in SILGenCleanup).
57
+ // / Extend trivial variables for lifetime diagnostics (only in SILGenCleanup).
58
58
HandleTrivialVariable_t handleTrivialVariable;
59
59
60
+ // / Whether verification of the computed liveness should be run even when the
61
+ // / global setting is off.
62
+ // / TODO: Remove this option.
63
+ bool ForceLivenessVerification;
64
+
60
65
public:
61
- OSSALifetimeCompletion (SILFunction *function, const DominanceInfo *domInfo,
62
- DeadEndBlocks &deadEndBlocks,
63
- HandleTrivialVariable_t handleTrivialVariable = IgnoreTrivialVariable)
66
+ OSSALifetimeCompletion (
67
+ SILFunction *function, const DominanceInfo *domInfo,
68
+ DeadEndBlocks &deadEndBlocks,
69
+ HandleTrivialVariable_t handleTrivialVariable = IgnoreTrivialVariable,
70
+ bool forceLivenessVerification = false )
64
71
: domInfo(domInfo), deadEndBlocks(deadEndBlocks),
65
- completedValues (function), handleTrivialVariable(handleTrivialVariable) {}
66
-
67
- // The kind of boundary at which to complete the lifetime.
68
- //
69
- // Liveness: "As early as possible." Consume the value after the last
70
- // non-consuming uses.
71
- // Availability: "As late as possible." Consume the value in the last blocks
72
- // beyond the non-consuming uses in which the value has been
73
- // consumed on no incoming paths.
72
+ completedValues (function), handleTrivialVariable(handleTrivialVariable),
73
+ ForceLivenessVerification(forceLivenessVerification) {}
74
+
75
+ // / The kind of boundary at which to complete the lifetime.
76
+ // /
77
+ // / Liveness: "As early as possible." Consume the value after the last
78
+ // / non-consuming uses.
79
+ // / Availability: "As late as possible." Consume the value in the last blocks
80
+ // / beyond the non-consuming uses in which the value has been
81
+ // / consumed on no incoming paths.
74
82
struct Boundary {
75
83
enum Value : uint8_t {
76
84
Liveness,
0 commit comments