private void calcPredecessors() {
    int maxLabel = blocks.getMaxLabel();
    IntList[] predecessors = new IntList[maxLabel];
    IntList exitPredecessors = new IntList(10);
    int sz = blocks.size();

    /*
     * For each block, find its successors, and add the block's label to
     * the successor's predecessors.
     */
    for (int i = 0; i < sz; i++) {
      BasicBlock one = blocks.get(i);
      int label = one.getLabel();
      IntList successors = one.getSuccessors();
      int ssz = successors.size();
      if (ssz == 0) {
        // This block exits.
        exitPredecessors.add(label);
      } else {
        for (int j = 0; j < ssz; j++) {
          int succLabel = successors.get(j);
          IntList succPreds = predecessors[succLabel];
          if (succPreds == null) {
            succPreds = new IntList(10);
            predecessors[succLabel] = succPreds;
          }
          succPreds.add(label);
        }
      }
    }

    // Sort and immutablize all the predecessor lists.
    for (int i = 0; i < maxLabel; i++) {
      IntList preds = predecessors[i];
      if (preds != null) {
        preds.sort();
        preds.setImmutable();
      }
    }

    exitPredecessors.sort();
    exitPredecessors.setImmutable();

    /*
     * The start label might not ever have had any predecessors
     * added to it (probably doesn't, because of how Java gets
     * translated into rop form). So, check for this and rectify
     * the situation if required.
     */
    if (predecessors[firstLabel] == null) {
      predecessors[firstLabel] = IntList.EMPTY;
    }

    this.predecessors = predecessors;
    this.exitPredecessors = exitPredecessors;
  }
Calculates the predecessor sets for each block as well as for the exit.
android/android_framework/dex-maker/src/main/java/com/android/dx/rop/code/RopMethod.java