service/method-inliner/CFGInliner.cpp
/*
 * Change the register numbers to not overlap with caller.
 */
Change the register numbers to not overlap with caller.
Change the register numbers to not overlap with caller .
void CFGInliner::remap_registers(cfg::ControlFlowGraph* callee,
                                 reg_t next_caller_reg) {
  for (auto& mie : cfg::InstructionIterable(*callee)) {
    auto insn = mie.insn;
    for (reg_t i = 0; i < insn->srcs_size(); ++i) {
      insn->set_src(i, insn->src(i) + next_caller_reg);
    }
    if (insn->has_dest()) {
      insn->set_dest(insn->dest() + next_caller_reg);
    }
  }
}
void CFGInliner :: remap_registers ( cfg :: ControlFlowGraph * callee , reg_t next_caller_reg ) { for ( auto & mie : cfg :: InstructionIterable ( * callee ) ) { auto insn = mie . insn ; for ( reg_t i = 0 ; i < insn -> srcs_size ( ) ; ++ i ) { insn -> set_src ( i , insn -> src ( i ) + next_caller_reg ) ; } if ( insn -> has_dest ( ) ) { insn -> set_dest ( insn -> dest ( ) + next_caller_reg ) ; } } }
Change the register numbers to not overlap with caller.
Change the register numbers to not overlap with caller .