private static void removeBranchesAfterGotos(BasicBlock bb){
  Instruction firstGoto=null;
  Instruction end=bb.lastRealInstruction();
  for (Enumeration<Instruction> branches=bb.enumerateBranchInstructions(); branches.hasMoreElements(); ) {
    Instruction s=branches.nextElement();
    if (Goto.conforms(s)) {
      firstGoto=s;
      break;
    }
  }
  if (firstGoto != null) {
    Enumeration<Instruction> ie=IREnumeration.forwardIntraBlockIE(firstGoto,end);
    ie.nextElement();
    while (ie.hasMoreElements()) {
      Instruction s=ie.nextElement();
      if (GuardResultCarrier.conforms(s)) {
        insertTrueGuard(s,GuardResultCarrier.getGuardResult(s));
      }
      s.remove();
    }
  }
}

private static void removeBranchesAfterGotos ( BasicBlock bb ) { Instruction firstGoto = null ; Instruction end = bb . lastRealInstruction ( ) ; for ( Enumeration < Instruction > branches = bb . enumerateBranchInstructions ( ) ; branches . hasMoreElements ( ) ; ) { Instruction s = branches . nextElement ( ) ; if ( Goto . conforms ( s ) ) { firstGoto = s ; break ; } } if ( firstGoto != null ) { Enumeration < Instruction > ie = IREnumeration . forwardIntraBlockIE ( firstGoto , end ) ; ie . nextElement ( ) ; while ( ie . hasMoreElements ( ) ) { Instruction s = ie . nextElement ( ) ; if ( GuardResultCarrier . conforms ( s ) ) { insertTrueGuard ( s , GuardResultCarrier . getGuardResult ( s ) ) ; } s . remove ( ) ; } } }
to maintain ir integrity , remove any branches that are after the first goto in the basic block .
