|
19 | 19 | using namespace swift; |
20 | 20 |
|
21 | 21 | static bool hasOnlyIncidentalUses(SILInstruction *inst, |
22 | | - bool disallowDebugUses = false) { |
| 22 | + bool preserveDebugInfo = false) { |
23 | 23 | for (SILValue result : inst->getResults()) { |
24 | 24 | for (Operand *use : result->getUses()) { |
25 | 25 | SILInstruction *user = use->getUser(); |
26 | 26 | if (!isIncidentalUse(user)) |
27 | 27 | return false; |
28 | | - if (disallowDebugUses && user->isDebugInstruction()) |
| 28 | + if (preserveDebugInfo && user->isDebugInstruction()) |
29 | 29 | return false; |
30 | 30 | } |
31 | 31 | } |
@@ -161,9 +161,9 @@ bool InstructionDeleter::trackIfDead(SILInstruction *inst) { |
161 | 161 | } |
162 | 162 |
|
163 | 163 | void InstructionDeleter::forceTrackAsDead(SILInstruction *inst) { |
164 | | - bool disallowDebugUses = inst->getFunction()->getEffectiveOptimizationMode() |
| 164 | + bool preserveDebugInfo = inst->getFunction()->getEffectiveOptimizationMode() |
165 | 165 | <= OptimizationMode::NoOptimization; |
166 | | - assert(hasOnlyIncidentalUses(inst, disallowDebugUses)); |
| 166 | + assert(hasOnlyIncidentalUses(inst, preserveDebugInfo)); |
167 | 167 | getCallbacks().notifyWillBeDeleted(inst); |
168 | 168 | deadInstructions.insert(inst); |
169 | 169 | } |
@@ -274,17 +274,16 @@ bool InstructionDeleter::deleteIfDead(SILInstruction *inst) { |
274 | 274 |
|
275 | 275 | void InstructionDeleter::forceDeleteAndFixLifetimes(SILInstruction *inst) { |
276 | 276 | SILFunction *fun = inst->getFunction(); |
277 | | - bool disallowDebugUses = |
| 277 | + bool preserveDebugInfo = |
278 | 278 | fun->getEffectiveOptimizationMode() <= OptimizationMode::NoOptimization; |
279 | | - assert(hasOnlyIncidentalUses(inst, disallowDebugUses)); |
| 279 | + assert(hasOnlyIncidentalUses(inst, preserveDebugInfo)); |
280 | 280 | deleteWithUses(inst, /*fixLifetimes*/ fun->hasOwnership()); |
281 | 281 | } |
282 | 282 |
|
283 | 283 | void InstructionDeleter::forceDelete(SILInstruction *inst) { |
284 | | - bool disallowDebugUses = |
285 | | - inst->getFunction()->getEffectiveOptimizationMode() <= |
286 | | - OptimizationMode::NoOptimization; |
287 | | - assert(hasOnlyIncidentalUses(inst, disallowDebugUses)); |
| 284 | + bool preserveDebugInfo = inst->getFunction()->getEffectiveOptimizationMode() |
| 285 | + <= OptimizationMode::NoOptimization; |
| 286 | + assert(hasOnlyIncidentalUses(inst, preserveDebugInfo)); |
288 | 287 | deleteWithUses(inst, /*fixLifetimes*/ false); |
289 | 288 | } |
290 | 289 |
|
|
0 commit comments