/** * Creates an exit block and attaches it to the CFG if this method * exits. Methods that never exit will not have an exit block. This * is called after edge-splitting and phi insertion, since the edges * going into the exit block should not be considered in those steps. */ /*package*/ void makeExitBlock() { if (exitBlockIndex >= 0) { throw new RuntimeException("must be called at most once"); } exitBlockIndex = blocks.size(); SsaBasicBlock exitBlock = new SsaBasicBlock(exitBlockIndex, maxLabel++, this); blocks.add(exitBlock); for (SsaBasicBlock block : blocks) { block.exitBlockFixup(exitBlock); } if (exitBlock.getPredecessors().cardinality() == 0) { // In cases where there is no exit... blocks.remove(exitBlockIndex); exitBlockIndex = -1; maxLabel--; } }
/** * Creates an exit block and attaches it to the CFG if this method * exits. Methods that never exit will not have an exit block. This * is called after edge-splitting and phi insertion, since the edges * going into the exit block should not be considered in those steps. */ /*package*/ void makeExitBlock() { if (exitBlockIndex >= 0) { throw new RuntimeException("must be called at most once"); } exitBlockIndex = blocks.size(); SsaBasicBlock exitBlock = new SsaBasicBlock(exitBlockIndex, maxLabel++, this); blocks.add(exitBlock); for (SsaBasicBlock block : blocks) { block.exitBlockFixup(exitBlock); } if (exitBlock.getPredecessors().cardinality() == 0) { // In cases where there is no exit... blocks.remove(exitBlockIndex); exitBlockIndex = -1; maxLabel--; } }
/** * Creates an exit block and attaches it to the CFG if this method * exits. Methods that never exit will not have an exit block. This * is called after edge-splitting and phi insertion, since the edges * going into the exit block should not be considered in those steps. */ /*package*/ void makeExitBlock() { if (exitBlockIndex >= 0) { throw new RuntimeException("must be called at most once"); } exitBlockIndex = blocks.size(); SsaBasicBlock exitBlock = new SsaBasicBlock(exitBlockIndex, maxLabel++, this); blocks.add(exitBlock); for (SsaBasicBlock block : blocks) { block.exitBlockFixup(exitBlock); } if (exitBlock.getPredecessors().cardinality() == 0) { // In cases where there is no exit... blocks.remove(exitBlockIndex); exitBlockIndex = -1; maxLabel--; } }
/** * Creates an exit block and attaches it to the CFG if this method * exits. Methods that never exit will not have an exit block. This * is called after edge-splitting and phi insertion, since the edges * going into the exit block should not be considered in those steps. */ /*package*/ void makeExitBlock() { if (exitBlockIndex >= 0) { throw new RuntimeException("must be called at most once"); } exitBlockIndex = blocks.size(); SsaBasicBlock exitBlock = new SsaBasicBlock(exitBlockIndex, maxLabel++, this); blocks.add(exitBlock); for (SsaBasicBlock block : blocks) { block.exitBlockFixup(exitBlock); } if (exitBlock.getPredecessors().cardinality() == 0) { // In cases where there is no exit... blocks.remove(exitBlockIndex); exitBlockIndex = -1; maxLabel--; } }
/** * Creates an exit block and attaches it to the CFG if this method * exits. Methods that never exit will not have an exit block. This * is called after edge-splitting and phi insertion, since the edges * going into the exit block should not be considered in those steps. */ /*package*/ void makeExitBlock() { if (exitBlockIndex >= 0) { throw new RuntimeException("must be called at most once"); } exitBlockIndex = blocks.size(); SsaBasicBlock exitBlock = new SsaBasicBlock(exitBlockIndex, maxLabel++, this); blocks.add(exitBlock); for (SsaBasicBlock block : blocks) { block.exitBlockFixup(exitBlock); } if (exitBlock.getPredecessors().cardinality() == 0) { // In cases where there is no exit... blocks.remove(exitBlockIndex); exitBlockIndex = -1; maxLabel--; } }
/** * Creates an exit block and attaches it to the CFG if this method * exits. Methods that never exit will not have an exit block. This * is called after edge-splitting and phi insertion, since the edges * going into the exit block should not be considered in those steps. */ /*package*/ void makeExitBlock() { if (exitBlockIndex >= 0) { throw new RuntimeException("must be called at most once"); } exitBlockIndex = blocks.size(); SsaBasicBlock exitBlock = new SsaBasicBlock(exitBlockIndex, maxLabel++, this); blocks.add(exitBlock); for (SsaBasicBlock block : blocks) { block.exitBlockFixup(exitBlock); } if (exitBlock.getPredecessors().cardinality() == 0) { // In cases where there is no exit... blocks.remove(exitBlockIndex); exitBlockIndex = -1; maxLabel--; } }
/** * Creates an exit block and attaches it to the CFG if this method * exits. Methods that never exit will not have an exit block. This * is called after edge-splitting and phi insertion, since the edges * going into the exit block should not be considered in those steps. */ /*package*/ void makeExitBlock() { if (exitBlockIndex >= 0) { throw new RuntimeException("must be called at most once"); } exitBlockIndex = blocks.size(); SsaBasicBlock exitBlock = new SsaBasicBlock(exitBlockIndex, maxLabel++, this); blocks.add(exitBlock); for (SsaBasicBlock block : blocks) { block.exitBlockFixup(exitBlock); } if (exitBlock.getPredecessors().cardinality() == 0) { // In cases where there is no exit... blocks.remove(exitBlockIndex); exitBlockIndex = -1; maxLabel--; } }
/** * Creates an exit block and attaches it to the CFG if this method * exits. Methods that never exit will not have an exit block. This * is called after edge-splitting and phi insertion, since the edges * going into the exit block should not be considered in those steps. */ /*package*/ void makeExitBlock() { if (exitBlockIndex >= 0) { throw new RuntimeException("must be called at most once"); } exitBlockIndex = blocks.size(); SsaBasicBlock exitBlock = new SsaBasicBlock(exitBlockIndex, maxLabel++, this); blocks.add(exitBlock); for (SsaBasicBlock block : blocks) { block.exitBlockFixup(exitBlock); } if (exitBlock.getPredecessors().cardinality() == 0) { // In cases where there is no exit... blocks.remove(exitBlockIndex); exitBlockIndex = -1; maxLabel--; } }