@@ -137,10 +137,10 @@ bool CanonicalizeOSSALifetime::computeCanonicalLiveness() {
137
137
auto addDefToWorklist = [&](Def def) {
138
138
if (!visitedDefs.insert (def.getValue ()))
139
139
return ;
140
- defUseWorklist .push_back (def);
141
- indexWorklist.push_back (defUseWorklist .size () - 1 );
140
+ discoveredDefs .push_back (def);
141
+ indexWorklist.push_back (discoveredDefs .size () - 1 );
142
142
};
143
- defUseWorklist .clear ();
143
+ discoveredDefs .clear ();
144
144
addDefToWorklist (Def::root (getCurrentDef ()));
145
145
// Only the first level of reborrows need to be consider. All nested inner
146
146
// adjacent reborrows and phis are encapsulated within their lifetimes.
@@ -153,7 +153,7 @@ bool CanonicalizeOSSALifetime::computeCanonicalLiveness() {
153
153
}
154
154
while (!indexWorklist.empty ()) {
155
155
auto index = indexWorklist.pop_back_val ();
156
- auto def = defUseWorklist [index];
156
+ auto def = discoveredDefs [index];
157
157
auto value = def.getValue ();
158
158
LLVM_DEBUG (llvm::dbgs () << " Uses of value:\n " ;
159
159
value->print (llvm::dbgs ()));
@@ -1160,16 +1160,16 @@ void CanonicalizeOSSALifetime::rewriteCopies(
1160
1160
SmallVectorImpl<DestroyValueInst *> const &newDestroys) {
1161
1161
assert (getCurrentDef ()->getOwnershipKind () == OwnershipKind::Owned);
1162
1162
1163
- // Shadow defUseWorklist in order to constrain its uses.
1164
- auto &defUseWorklist = this ->defUseWorklist ;
1163
+ // Shadow discoveredDefs in order to constrain its uses.
1164
+ auto &discoveredDefs = this ->discoveredDefs ;
1165
1165
1166
1166
SmallVector<unsigned , 8 > indexWorklist;
1167
1167
ValueSet visitedDefs (getCurrentDef ()->getFunction ());
1168
1168
auto addDefToWorklist = [&](Def def) {
1169
1169
if (!visitedDefs.insert (def.getValue ()))
1170
1170
return ;
1171
- defUseWorklist .push_back (def);
1172
- indexWorklist.push_back (defUseWorklist .size () - 1 );
1171
+ discoveredDefs .push_back (def);
1172
+ indexWorklist.push_back (discoveredDefs .size () - 1 );
1173
1173
};
1174
1174
1175
1175
InstructionSetVector instsToDelete (getCurrentDef ()->getFunction ());
@@ -1217,13 +1217,13 @@ void CanonicalizeOSSALifetime::rewriteCopies(
1217
1217
return true ;
1218
1218
};
1219
1219
1220
- defUseWorklist .clear ();
1220
+ discoveredDefs .clear ();
1221
1221
addDefToWorklist (Def::root (getCurrentDef ()));
1222
1222
// Perform a def-use traversal, visiting each use operand.
1223
1223
1224
1224
while (!indexWorklist.empty ()) {
1225
1225
auto index = indexWorklist.pop_back_val ();
1226
- auto def = defUseWorklist [index];
1226
+ auto def = discoveredDefs [index];
1227
1227
switch (def) {
1228
1228
case Def::Kind::BorrowedFrom:
1229
1229
case Def::Kind::Reborrow:
0 commit comments