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);
  }
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)) {
       
       
        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);
         
          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);
          }
        }
      }
    }
   
    increments.resetAll(RCDir.INCR);
  }
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)) { 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); 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); } } } } increments.resetall(rcdir.incr); }