(&mut self)
| 523 | } |
| 524 | |
| 525 | fn gen_arg_setup(&mut self) { |
| 526 | if let Some(entry_bb) = self.f.layout.entry_block() { |
| 527 | trace!( |
| 528 | "gen_arg_setup: entry BB {} args are:\n{:?}", |
| 529 | entry_bb, |
| 530 | self.f.dfg.block_params(entry_bb) |
| 531 | ); |
| 532 | |
| 533 | for (i, param) in self.f.dfg.block_params(entry_bb).iter().enumerate() { |
| 534 | if self.value_ir_uses[*param] == ValueUseState::Unused { |
| 535 | continue; |
| 536 | } |
| 537 | let regs = writable_value_regs(self.value_regs[*param]); |
| 538 | for insn in self |
| 539 | .vcode |
| 540 | .vcode |
| 541 | .abi |
| 542 | .gen_copy_arg_to_regs(&self.vcode.vcode.sigs, i, regs, &mut self.vregs) |
| 543 | .into_iter() |
| 544 | { |
| 545 | self.emit(insn); |
| 546 | } |
| 547 | } |
| 548 | if let Some(insn) = self |
| 549 | .vcode |
| 550 | .vcode |
| 551 | .abi |
| 552 | .gen_retval_area_setup(&self.vcode.vcode.sigs, &mut self.vregs) |
| 553 | { |
| 554 | self.emit(insn); |
| 555 | } |
| 556 | |
| 557 | // The `args` instruction below must come first. Finish |
| 558 | // the current "IR inst" (with a default source location, |
| 559 | // as for other special instructions inserted during |
| 560 | // lowering) and continue the scan backward. |
| 561 | self.finish_ir_inst(Default::default()); |
| 562 | |
| 563 | if let Some(insn) = self.vcode.vcode.abi.take_args() { |
| 564 | self.emit(insn); |
| 565 | } |
| 566 | } |
| 567 | } |
| 568 | |
| 569 | /// Generate the return instruction. |
| 570 | pub fn gen_return(&mut self, rets: &[ValueRegs<Reg>]) { |
no test coverage detected