service/method-inliner/CFGInliner.cpp
/*
 * Convert load-params to moves.
 */
Convert load-params to moves.
Convert load - params to moves .
void CFGInliner::move_arg_regs(cfg::ControlFlowGraph* callee,
                               const std::vector<reg_t>& srcs) {
  auto param_insns = callee->get_param_instructions();
  reg_t i = 0;
  for (auto& mie : ir_list::InstructionIterable(param_insns)) {
    IRInstruction* load = mie.insn;
    IRInstruction* move =
        new IRInstruction(opcode::load_param_to_move(mie.insn->opcode()));
    move->set_src(0, srcs.at(i));
    move->set_dest(load->dest());
    mie.insn = move;
    i++;
    delete load;
  }
}
void CFGInliner :: move_arg_regs ( cfg :: ControlFlowGraph * callee , const std :: vector < reg_t > & srcs ) { auto param_insns = callee -> get_param_instructions ( ) ; reg_t i = 0 ; for ( auto & mie : ir_list :: InstructionIterable ( param_insns ) ) { IRInstruction * load = mie . insn ; IRInstruction * move = new IRInstruction ( opcode :: load_param_to_move ( mie . insn -> opcode ( ) ) ) ; move -> set_src ( 0 , srcs . at ( i ) ) ; move -> set_dest ( load -> dest ( ) ) ; mie . insn = move ; i ++ ; delete load ; } }
Convert load-params to moves.
Convert load - params to moves .
// replace the load instruction with the new move instruction