Exemplo n.º 1
0
Arquivo: where.cpp Projeto: wh5a/xgill
void RemoveValBit(FrameId frame, BlockMemory *mcfg,
                  const GuardBitVector &input, GuardBitVector *output)
{
  for (size_t iind = 0; iind < input.Size(); iind++) {
    const GuardBit &igb = input[iind];

    RemoveFrameMapper mapper(frame);
    Bit *nbit = igb.bit->DoMap(&mapper);

    GuardBitVector remove_res;
    mcfg->TranslateBit(TRK_RemoveVal, 0, nbit, &remove_res);
    nbit->DecRef();

    for (size_t rind = 0; rind < remove_res.Size(); rind++) {
      const GuardBit &rgb = remove_res[rind];
      rgb.IncRef();
      igb.guard->IncRef();

      Bit *new_guard = Bit::MakeAnd(igb.guard, rgb.guard);
      output->PushBack(GuardBit(rgb.bit, new_guard));
    }
  }

  output->SortCombine();
}