use of org.candle.decompiler.intermediate.code.SwitchIntermediate in project candle-decompiler by bradsdavis.
the class CaseEndRangeIntermediateVisitor method visitCaseIntermediate.
@Override
public void visitCaseIntermediate(CaseIntermediate line) {
SwitchIntermediate si = (SwitchIntermediate) igc.getSinglePredecessor(line);
List<CaseIntermediate> switchCases = igc.getCases(si);
int position = line.getBlockRange().getStart().getPosition();
CaseIntermediate next = findNextCase(switchCases, position);
if (next != null) {
line.getBlockRange().setEnd(next.getBlockRange().getStart().getPrev());
} else {
//we should get the end from the parent.
line.getBlockRange().setEnd(si.getBlockRange().getEnd());
}
}
use of org.candle.decompiler.intermediate.code.SwitchIntermediate in project candle-decompiler by bradsdavis.
the class MultiConditionalToSwitchIntermediate method visitMultiBranchIntermediate.
@Override
public void visitMultiBranchIntermediate(MultiBranchIntermediate line) {
SwitchIntermediate si = new SwitchIntermediate(line.getInstruction(), line);
igc.getGraph().addVertex(si);
igc.redirectPredecessors(line, si);
igc.redirectSuccessors(line, si);
igc.getGraph().removeVertex(line);
}
Aggregations