Instr lastInstr = current.getLastInstr(); if (lastInstr instanceof JumpInstr) { // if jumping to next BB then remove it tryAndRemoveUnneededJump(list.get(i + 1), cfg, lastInstr, current); Instr lastInstr = current.getLastInstr();
Instr lastInstr = current.getLastInstr(); if (lastInstr instanceof JumpInstr) { // if jumping to next BB then remove it tryAndRemoveUnneededJump(list.get(i + 1), cfg, lastInstr, current); Instr lastInstr = current.getLastInstr();
Instr lastInstr = current.getLastInstr(); if (lastInstr instanceof JumpInstr) { // if jumping to next BB then remove it tryAndRemoveUnneededJump(list[i + 1], cfg, lastInstr, current); Instr lastInstr = current.getLastInstr();
Instr lastInstr = current.getLastInstr(); if (lastInstr instanceof JumpInstr) { // if jumping to next BB then remove it tryAndRemoveUnneededJump(list[i + 1], cfg, lastInstr, current); Instr lastInstr = current.getLastInstr();
private void addMissingJumps() { for (BasicBlock bb: cfg.getBasicBlocks()) { boolean fallThrough = false; Label jumpLabel = null; for (Edge<BasicBlock> edge : cfg.getOutgoingEdges(bb)) { if (edge.getType() == EdgeType.FALL_THROUGH) { // Assume next BB will be correct fallThrough = true; } else if (edge.getType() == EdgeType.REGULAR || edge.getType() == EdgeType.EXIT) { // Not sure if we can have regular and fallthrough but only add regular if no fallthrough if (fallThrough) continue; jumpLabel = edge.getDestination().getData().getLabel(); } } if (fallThrough) continue; // we know this will just go to next BB already so no missing jump. if (jumpLabel == null) continue; // last instr does not transfer control so nothing to add. Instr lastInstr = bb.getLastInstr(); if (lastInstr != null && !lastInstr.transfersControl()) { bb.addInstr(new JumpInstr(jumpLabel)); } } }
private void addMissingJumps() { for (BasicBlock bb: cfg.getBasicBlocks()) { boolean fallThrough = false; Label jumpLabel = null; for (Edge<BasicBlock> edge : cfg.getOutgoingEdges(bb)) { if (edge.getType() == EdgeType.FALL_THROUGH) { // Assume next BB will be correct fallThrough = true; } else if (edge.getType() == EdgeType.REGULAR || edge.getType() == EdgeType.EXIT) { // Not sure if we can have regular and fallthrough but only add regular if no fallthrough if (fallThrough) continue; jumpLabel = edge.getDestination().getData().getLabel(); } } if (fallThrough) continue; // we know this will just go to next BB already so no missing jump. if (jumpLabel == null) continue; // last instr does not transfer control so nothing to add. Instr lastInstr = bb.getLastInstr(); if (lastInstr != null && !lastInstr.transfersControl()) { bb.addInstr(new JumpInstr(jumpLabel)); } } }
Instr lastInstr = a.getLastInstr(); if (lastInstr instanceof JumpInstr) a.removeInstr(lastInstr); Instr fixupLastInstr = fixupBB.getLastInstr(); if (fixupLastInstr instanceof JumpTargetInstr) { ((JumpTargetInstr) fixupLastInstr).setJumpTarget(a.getLabel());
Instr lastInstr = a.getLastInstr(); if (lastInstr instanceof JumpInstr) a.removeInstr(lastInstr); Instr fixupLastInstr = fixupBB.getLastInstr(); if (fixupLastInstr instanceof JumpTargetInstr) { ((JumpTargetInstr) fixupLastInstr).setJumpTarget(a.getLabel());
Instr lastInstr = a.getLastInstr(); if (lastInstr instanceof JumpInstr) a.removeInstr(lastInstr);
Instr lastInstr = a.getLastInstr(); if (lastInstr instanceof JumpInstr) a.removeInstr(lastInstr);