for (Enumeration enum = ir.cfg.nodes(); enum.hasMoreElements();) { OPT_BasicBlock block = (OPT_BasicBlock)enum.nextElement();
for (Enumeration bbEnum = ir.cfg.nodes(); bbEnum.hasMoreElements();) { OPT_BasicBlock block = (OPT_BasicBlock)bbEnum.nextElement();
  public void perform(OPT_IR ir) {    // make sure the dominator computation completed successfully    if (!ir.HIRInfo.dominatorsAreComputed)      return;    // make sure dominator tree is computed    if (ir.HIRInfo.dominatorTree == null)      return;    // for each X in a bottom-up traversal of the dominator tree do    OPT_DominatorTree tree = ir.HIRInfo.dominatorTree;    for (Enumeration x = tree.getBottomUpEnumerator(); x.hasMoreElements();) {      OPT_DominatorTreeNode v = (OPT_DominatorTreeNode)x.nextElement();      OPT_BasicBlock X = v.getBlock();      if (DEBUG)        System.out.println("Computing frontier for node " + X);      OPT_BitVector DF = new OPT_BitVector(ir.getMaxBasicBlockNumber()+1);      v.setDominanceFrontier(DF);      // for each Y in Succ(X) do      for (OPT_BasicBlockEnumeration y = X.getOut(); y.hasMoreElements();) {        OPT_BasicBlock Y = y.next();        // skip EXIT node        if (Y.isExit())          continue;        // if (idom(Y)!=X) then DF(X) <- DF(X) U Y        if (OPT_LTDominatorInfo.getIdom(Y) != X)          DF.set(Y.getNumber());      }      if (DEBUG)        System.out.println("After local " + DF);      //        for each Z in {idom(z) = X} do      for (Enumeration z = tree.getChildren(X); z.hasMoreElements();) {        OPT_DominatorTreeNode zVertex = (OPT_DominatorTreeNode)z.nextElement();        OPT_BasicBlock Z = zVertex.getBlock();        if (DEBUG)          System.out.println("Processing Z = " + Z);        // for each Y in DF(Z) do        for (OPT_BasicBlockEnumeration y =             zVertex.domFrontierEnumerator(ir); y.hasMoreElements();) {          OPT_BasicBlock Y = y.next();          // if (idom(Y)!=X) then DF(X) <- DF(X) U Y          if (OPT_LTDominatorInfo.getIdom(Y) != X)            DF.set(Y.getNumber());        }      }      if (DEBUG)        System.out.println("After up " + DF);    }    if (DEBUG) {      for (Enumeration enum = ir.cfg.nodes(); enum.hasMoreElements();) {        OPT_BasicBlock block = (OPT_BasicBlock)enum.nextElement();        if (block.isExit())          continue;        System.out.println(block + " DF: " + tree.getDominanceFrontier(block));      }    }