// Clear out all increments
public void dumpIncrements(Statement stmt, Block block,
      ListIterator<Statement> stmtIt, RCTracker increments) {
    for (RefCountType rcType: RefcountPass.RC_TYPES) {
      for (Entry<AliasKey, Long> e: increments.rcIter(rcType, RCDir.INCR)) {
        // TODO: can we guarantee that the refcount var is available in the
        //       current scope?
        Var var = increments.getRefCountVar(e.getKey());
        assert(var != null);
        Long incr = e.getValue();
        assert(incr >= 0);
        if (incr > 0 && RefCounting.trackRefCount(var, rcType)) {
          boolean varInit = stmt != null &&
                   stmt.type() == StatementType.INSTRUCTION &&
                   stmt.instruction().isInitialized(var);
          // TODO: what if not initialized in a conditional? Should insert before
          if (stmt != null &&
                  (stmt.type() == StatementType.INSTRUCTION &&
                  !(var.storage() == Alloc.ALIAS && varInit))) {
            insertIncrBefore(block, stmtIt, var, incr, rcType);
          } else {
            insertIncrAfter(block, stmtIt, var, incr, rcType);
          }
        }
      }
    }
    // Clear out all increments
    increments.resetAll(RCDir.INCR);
  }
}
}
// Clear out all increments
increments.resetAll(RCDir.INCR);
}
if (stmt != null &&
(stmt.type() == StatementType.INSTRUCTION &&
!(var.storage() == Alloc.ALIAS && varInit))) {
insertIncrBefore(block, stmtIt, var, incr, rcType);
} else {
insertIncrAfter(block, stmtIt, var, incr, rcType);
}
}
}
}
// Clear out all increments
increments.resetAll(RCDir.INCR);
}
// current scope?
Var var = increments.getRefCountVar(e.getKey());
assert(var != null);
Long incr = e.getValue();
assert(incr >= 0);
if (incr > 0 && RefCounting.trackRefCount(var, rcType)) {
boolean varInit = stmt != null &&
stmt.type() == StatementType.INSTRUCTION &&
stmt.instruction().isInitialized(var);
// TODO: what if not initialized in a conditional? Should insert before
if (stmt != null &&
(stmt.type() == StatementType.INSTRUCTION &&
!(var.storage() == Alloc.ALIAS && varInit))) {
insertIncrBefore(block, stmtIt, var, incr, rcType);
} else {
insertIncrAfter(block, stmtIt, var, incr, rcType);
}
}
}
}
// Clear out all increments
increments.resetAll(RCDir.INCR);
}