@@ -54,6 +54,10 @@ class ValueLifetimeAnalysis {
54
54
// / end the value's lifetime.
55
55
using Frontier = SmallVector<SILInstruction *, 4 >;
56
56
57
+ // / A type erased version of frontier so callers can customize the inline
58
+ // / size.
59
+ using FrontierImpl = SmallVectorImpl<SILInstruction *>;
60
+
57
61
// / Constructor for the value \p def with a specific range of users.
58
62
// /
59
63
// / We templatize over the RangeTy so that we can initialize
@@ -106,7 +110,7 @@ class ValueLifetimeAnalysis {
106
110
// /
107
111
// / If \p deBlocks is provided, all dead-end blocks are ignored. This
108
112
// / prevents unreachable-blocks to be included in the frontier.
109
- bool computeFrontier (Frontier &frontier, Mode mode,
113
+ bool computeFrontier (FrontierImpl &frontier, Mode mode,
110
114
DeadEndBlocks *deBlocks = nullptr );
111
115
112
116
ArrayRef<std::pair<TermInst *, unsigned >> getCriticalEdges () {
@@ -125,7 +129,7 @@ class ValueLifetimeAnalysis {
125
129
}
126
130
127
131
// / Checks if there is a dealloc_ref inside the value's live range.
128
- bool containsDeallocRef (const Frontier &frontier);
132
+ bool containsDeallocRef (const FrontierImpl &frontier);
129
133
130
134
// / For debug dumping.
131
135
void dump () const ;
@@ -159,7 +163,7 @@ class ValueLifetimeAnalysis {
159
163
// / Otherwise \p valueOrStackLoc must be a value type and in this case, inserts
160
164
// / destroy_value at each instruction of the \p frontier.
161
165
void endLifetimeAtFrontier (SILValue valueOrStackLoc,
162
- const ValueLifetimeAnalysis::Frontier &frontier,
166
+ const ValueLifetimeAnalysis::FrontierImpl &frontier,
163
167
SILBuilderContext &builderCtxt,
164
168
InstModCallbacks callbacks);
165
169
0 commit comments