(&self, tcx: TyCtxt<'_>)
| 627 | if uses_runtime_implementation && !needs_compiled_primitive_operator { |
| 628 | breadcrumbs::log!( |
| 629 | breadcrumbs::LogLevel::Info, |
| 630 | "mono-lowering", |
| 631 | format!("Using runtime implementation for mono function: {instance:?}") |
| 632 | ); |
| 633 | return; |
| 634 | } |
| 635 | |
| 636 | if !lowered_instances.insert(instance) { |
| 637 | return; |
| 638 | } |
| 639 | |
| 640 | if matches!( |
| 641 | instance.def, |
| 642 | InstanceKind::Intrinsic(..) | InstanceKind::LlvmIntrinsic(..) | InstanceKind::Virtual(..) |
| 643 | ) { |
| 644 | breadcrumbs::log!( |
| 645 | breadcrumbs::LogLevel::Warn, |
| 646 | "mono-lowering", |
| 647 | format!( |
| 648 | "Skipping mono function without a concrete MIR body: {:?}", |
| 649 | instance |
| 650 | ) |
| 651 | ); |
| 652 | return; |
| 653 | } |
| 654 | |
| 655 | let name = mono_item_name(tcx, instance); |
| 656 | let mir = tcx.instance_mir(instance.def); |
| 657 | breadcrumbs::log!( |
| 658 | breadcrumbs::LogLevel::Info, |
| 659 | "mono-lowering", |
| 660 | format!( |
| 661 | "Lowering mono function {} from {:?}", |
| 662 | name.method_name, instance |
| 663 | ) |
| 664 | ); |
| 665 | |
| 666 | let mut oomir_function = lower1::mir_to_oomir( |
| 667 | tcx, |
| 668 | instance, |
| 669 | mir, |
| 670 | Some(name.clone()), |
| 671 | true, |
| 672 | &mut oomir_module.data_types, |
| 673 | &mut oomir_module.external_interfaces, |
| 674 | ); |
| 675 | if tcx.is_intrinsic(instance.def_id(), rustc_span::sym::const_allocate) { |
| 676 | let result_ty = oomir_function.signature.ret.as_ref().clone(); |
| 677 | let result = "__const_allocate_result".to_string(); |
| 678 | let entry = "entry".to_string(); |
| 679 | oomir_function.body = oomir::CodeBlock { |
| 680 | entry: entry.clone(), |
| 681 | basic_blocks: HashMap::from_iter([( |
| 682 | entry.clone(), |
| 683 | oomir::BasicBlock { |
| 684 | label: entry, |
| 685 | instructions: vec![ |
| 686 | oomir::Instruction::InvokeStatic { |
nothing calls this directly
no test coverage detected