(cx: &'a Self::CodegenCx, llbb: Self::BasicBlock)
| 635 | |
| 636 | impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> { |
| 637 | fn build(cx: &'a Self::CodegenCx, llbb: Self::BasicBlock) -> Self { |
| 638 | let cursor = cx.builder.select_block_by_id(llbb); |
| 639 | // FIXME(eddyb) change `Self::Function` to be more like a function index. |
| 640 | let current_fn = { |
| 641 | let emit = cx.emit_with_cursor(cursor); |
| 642 | let selected_function = emit.selected_function().unwrap(); |
| 643 | let selected_function = &emit.module_ref().functions[selected_function]; |
| 644 | let def_inst = selected_function.def.as_ref().unwrap(); |
| 645 | let def = def_inst.result_id.unwrap(); |
| 646 | let ty = def_inst.operands[1].unwrap_id_ref(); |
| 647 | def.with_type(ty) |
| 648 | }; |
| 649 | Self { |
| 650 | cx, |
| 651 | cursor, |
| 652 | current_fn, |
| 653 | basic_block: llbb, |
| 654 | current_span: Default::default(), |
| 655 | } |
| 656 | } |
| 657 | |
| 658 | fn cx(&self) -> &Self::CodegenCx { |
| 659 | self.cx |
nothing calls this directly
no test coverage detected