// TODO: can we guarantee that the refcount var is available in the
//       current scope?
public void dumpDecrements(Block block, RCTracker increments) {
    // TODO: can we guarantee that the refcount var is available in the
    //       current scope?
    for (RefCountType rcType: RefcountPass.RC_TYPES) {
      for (Entry<AliasKey, Long> e: increments.rcIter(rcType, RCDir.DECR)) {
        assert (e.getValue() <= 0);
        Var var = increments.getRefCountVar(e.getKey());
        if (RefCounting.trackRefCount(var, rcType)) {
          Arg amount = Arg.newInt(e.getValue() * -1);
          block.addCleanup(var, RefCountOp.decrRef(rcType, var, amount));
        }
      }
    }
    // Clear out all decrements
    increments.resetAll(RCDir.DECR);
  }
public void dumpDecrements(Block block, RCTracker increments) {
// TODO: can we guarantee that the refcount var is available in the
// current scope?
for (RefCountType rcType: RefcountPass.RC_TYPES) {
for (Entry<AliasKey, Long> e: increments.rcIter(rcType, RCDir.DECR)) {
public void dumpDecrements(Block block, RCTracker increments) {
// TODO: can we guarantee that the refcount var is available in the
// current scope?
for (RefCountType rcType: RefcountPass.RC_TYPES) {
for (Entry<AliasKey, Long> e: increments.rcIter(rcType, RCDir.DECR)) {
assert (e.getValue() <= 0);
Var var = increments.getRefCountVar(e.getKey());
if (RefCounting.trackRefCount(var, rcType)) {
Arg amount = Arg.newInt(e.getValue() * -1);
block.addCleanup(var, RefCountOp.decrRef(rcType, var, amount));
}
}
}
public void dumpDecrements(Block block, RCTracker increments) {
// TODO: can we guarantee that the refcount var is available in the
// current scope?
for (RefCountType rcType: RefcountPass.RC_TYPES) {
for (Entry<AliasKey, Long> e: increments.rcIter(rcType, RCDir.DECR)) {
assert (e.getValue() <= 0);
Var var = increments.getRefCountVar(e.getKey());
if (RefCounting.trackRefCount(var, rcType)) {
Arg amount = Arg.newInt(e.getValue() * -1);
block.addCleanup(var, RefCountOp.decrRef(rcType, var, amount));
}
}
}
// Clear out all decrements
increments.resetAll(RCDir.DECR);
}