@@ -43,34 +43,42 @@ class OSSALifetimeCompletion {
4343 enum HandleTrivialVariable_t { IgnoreTrivialVariable, ExtendTrivialVariable };
4444
4545private:
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.
4949 const DominanceInfo *domInfo = nullptr ;
5050
5151 DeadEndBlocks &deadEndBlocks;
5252
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.
5555 ValueSet completedValues;
5656
57- // Extend trivial variables for lifetime diagnostics (only in SILGenCleanup).
57+ // / Extend trivial variables for lifetime diagnostics (only in SILGenCleanup).
5858 HandleTrivialVariable_t handleTrivialVariable;
5959
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+
6065public:
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 )
6471 : 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.
7482 struct Boundary {
7583 enum Value : uint8_t {
7684 Liveness,
0 commit comments