@@ -105,7 +105,7 @@ static bool endLifetimeAtLivenessBoundary(SILValue value,
105
105
}
106
106
107
107
namespace {
108
- // / Implements OSSALifetimeCompletion::visitUnreachableLifetimeEnds . Finds
108
+ // / Implements OSSALifetimeCompletion::visitAvailabilityBoundary . Finds
109
109
// / positions as near as possible to unreachables at which `value`'s lifetime
110
110
// / is available.
111
111
// /
@@ -118,7 +118,7 @@ namespace {
118
118
// / the value is available--these are the blocks
119
119
// / without successors or with at least one
120
120
// / unavailable successor.
121
- class VisitUnreachableLifetimeEnds {
121
+ class AvailabilityBoundaryVisitor {
122
122
// / The value whose dead-end block lifetime ends are to be visited.
123
123
SILValue value;
124
124
@@ -134,8 +134,8 @@ class VisitUnreachableLifetimeEnds {
134
134
BasicBlockSetVector region;
135
135
136
136
public:
137
- VisitUnreachableLifetimeEnds (SILValue value,
138
- OSSALifetimeCompletion::AllowLeaks_t allowLeaks)
137
+ AvailabilityBoundaryVisitor (SILValue value,
138
+ OSSALifetimeCompletion::AllowLeaks_t allowLeaks)
139
139
: value(value), allowLeaks(allowLeaks), starts(value->getFunction ()),
140
140
region(value->getFunction ()) {}
141
141
@@ -198,7 +198,7 @@ class VisitUnreachableLifetimeEnds {
198
198
};
199
199
};
200
200
201
- void VisitUnreachableLifetimeEnds ::computeRegion (
201
+ void AvailabilityBoundaryVisitor ::computeRegion (
202
202
const SSAPrunedLiveness &liveness) {
203
203
// (1) Compute the complete liveness boundary.
204
204
PrunedLivenessBoundary boundary;
@@ -258,7 +258,7 @@ void VisitUnreachableLifetimeEnds::computeRegion(
258
258
}
259
259
}
260
260
261
- void VisitUnreachableLifetimeEnds ::propagateAvailablity (Result &result) {
261
+ void AvailabilityBoundaryVisitor ::propagateAvailablity (Result &result) {
262
262
// Initialize per-block state.
263
263
// - all blocks outside of the region are ::Unavailable (automatically
264
264
// initialized)
@@ -299,7 +299,7 @@ void VisitUnreachableLifetimeEnds::propagateAvailablity(Result &result) {
299
299
}
300
300
}
301
301
302
- void VisitUnreachableLifetimeEnds ::visitAvailabilityBoundary (
302
+ void AvailabilityBoundaryVisitor ::visitAvailabilityBoundary (
303
303
Result const &result, llvm::function_ref<void (SILInstruction *)> visit) {
304
304
for (auto *block : region) {
305
305
auto available = result.getState (block) == State::Available;
@@ -328,15 +328,15 @@ void VisitUnreachableLifetimeEnds::visitAvailabilityBoundary(
328
328
}
329
329
} // end anonymous namespace
330
330
331
- void OSSALifetimeCompletion::visitUnreachableLifetimeEnds (
331
+ void OSSALifetimeCompletion::visitAvailabilityBoundary (
332
332
SILValue value, AllowLeaks_t allowLeaks, const SSAPrunedLiveness &liveness,
333
333
llvm::function_ref<void (SILInstruction *)> visit) {
334
334
335
- VisitUnreachableLifetimeEnds visitor (value, allowLeaks);
335
+ AvailabilityBoundaryVisitor visitor (value, allowLeaks);
336
336
337
337
visitor.computeRegion (liveness);
338
338
339
- VisitUnreachableLifetimeEnds ::Result result (value->getFunction ());
339
+ AvailabilityBoundaryVisitor ::Result result (value->getFunction ());
340
340
341
341
visitor.propagateAvailablity (result);
342
342
@@ -347,7 +347,7 @@ static bool endLifetimeAtAvailabilityBoundary(
347
347
SILValue value, OSSALifetimeCompletion::AllowLeaks_t allowLeaks,
348
348
const SSAPrunedLiveness &liveness) {
349
349
bool changed = false ;
350
- OSSALifetimeCompletion::visitUnreachableLifetimeEnds (
350
+ OSSALifetimeCompletion::visitAvailabilityBoundary (
351
351
value, allowLeaks, liveness, [&](auto *unreachable) {
352
352
SILBuilderWithScope builder (unreachable);
353
353
endOSSALifetime (value, builder);
0 commit comments