Skip to content

Commit 962c290

Browse files
committed
Rename InstructionDeleter disallowDebugUses to preserveDebugInfo
CanonicalizeInstruction will be migrated to the InstructionDeleter, so make sure we use consistent names.
1 parent 8c6c88a commit 962c290

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

lib/SILOptimizer/Utils/InstructionDeleter.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
using namespace swift;
2020

2121
static bool hasOnlyIncidentalUses(SILInstruction *inst,
22-
bool disallowDebugUses = false) {
22+
bool preserveDebugInfo = false) {
2323
for (SILValue result : inst->getResults()) {
2424
for (Operand *use : result->getUses()) {
2525
SILInstruction *user = use->getUser();
2626
if (!isIncidentalUse(user))
2727
return false;
28-
if (disallowDebugUses && user->isDebugInstruction())
28+
if (preserveDebugInfo && user->isDebugInstruction())
2929
return false;
3030
}
3131
}
@@ -161,9 +161,9 @@ bool InstructionDeleter::trackIfDead(SILInstruction *inst) {
161161
}
162162

163163
void InstructionDeleter::forceTrackAsDead(SILInstruction *inst) {
164-
bool disallowDebugUses = inst->getFunction()->getEffectiveOptimizationMode()
164+
bool preserveDebugInfo = inst->getFunction()->getEffectiveOptimizationMode()
165165
<= OptimizationMode::NoOptimization;
166-
assert(hasOnlyIncidentalUses(inst, disallowDebugUses));
166+
assert(hasOnlyIncidentalUses(inst, preserveDebugInfo));
167167
getCallbacks().notifyWillBeDeleted(inst);
168168
deadInstructions.insert(inst);
169169
}
@@ -274,17 +274,16 @@ bool InstructionDeleter::deleteIfDead(SILInstruction *inst) {
274274

275275
void InstructionDeleter::forceDeleteAndFixLifetimes(SILInstruction *inst) {
276276
SILFunction *fun = inst->getFunction();
277-
bool disallowDebugUses =
277+
bool preserveDebugInfo =
278278
fun->getEffectiveOptimizationMode() <= OptimizationMode::NoOptimization;
279-
assert(hasOnlyIncidentalUses(inst, disallowDebugUses));
279+
assert(hasOnlyIncidentalUses(inst, preserveDebugInfo));
280280
deleteWithUses(inst, /*fixLifetimes*/ fun->hasOwnership());
281281
}
282282

283283
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));
288287
deleteWithUses(inst, /*fixLifetimes*/ false);
289288
}
290289

0 commit comments

Comments
 (0)