do not need 'allow dead instructions'
after copies are collected (instruction is dead only if all copies are dead)
This commit is contained in:
@@ -189,18 +189,23 @@ public class PseudocodeImpl implements Pseudocode {
|
|||||||
return deadInstructions;
|
return deadInstructions;
|
||||||
}
|
}
|
||||||
deadInstructions = Lists.newArrayList();
|
deadInstructions = Lists.newArrayList();
|
||||||
Collection<Instruction> allowedDeadInstructions = collectAllowedDeadInstructions();
|
|
||||||
|
|
||||||
for (Instruction instruction : mutableInstructionList) {
|
for (Instruction instruction : mutableInstructionList) {
|
||||||
if (((InstructionImpl)instruction).isDead()) {
|
if (isDead(instruction)) {
|
||||||
if (!allowedDeadInstructions.contains(instruction)) {
|
deadInstructions.add(instruction);
|
||||||
deadInstructions.add(instruction);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return deadInstructions;
|
return deadInstructions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isDead(@NotNull Instruction instruction) {
|
||||||
|
if (!((InstructionImpl)instruction).isDead()) return false;
|
||||||
|
for (Instruction copy : instruction.getCopies()) {
|
||||||
|
if (!((InstructionImpl)copy).isDead()) return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//for tests only
|
//for tests only
|
||||||
@NotNull
|
@NotNull
|
||||||
public List<PseudocodeLabel> getLabels() {
|
public List<PseudocodeLabel> getLabels() {
|
||||||
|
|||||||
Reference in New Issue
Block a user