rustc_codegen_ssa/traits/
misc.rs1use std::cell::RefCell;
2
3use rustc_data_structures::fx::FxHashMap;
4use rustc_middle::ty::{self, Instance, Intrinsic, Ty};
5use rustc_session::{PointerAuthSchema, Session};
6
7use super::BackendTypes;
8
9pub trait MiscCodegenMethods<'tcx>: BackendTypes {
10 fn vtables(
11 &self,
12 ) -> &RefCell<FxHashMap<(Ty<'tcx>, Option<ty::ExistentialTraitRef<'tcx>>), Self::Value>>;
13 fn apply_vcall_visibility_metadata(
14 &self,
15 _trait_hierarchy: &[ty::ExistentialTraitRef<'tcx>],
16 _vtable: Self::Value,
17 ) {
18 }
19 fn get_fn(&self, instance: Instance<'tcx>) -> Self::Function;
20 fn get_fn_addr(
21 &self,
22 instance: Instance<'tcx>,
23 pointer_auth_schema: Option<&PointerAuthSchema>,
24 ) -> Self::Value;
25 fn eh_personality(&self) -> Self::Function;
26 fn sess(&self) -> &Session;
27 fn set_frame_pointer_type(&self, llfn: Self::Function);
28 fn apply_target_cpu_attr(&self, llfn: Self::Function);
29 fn apply_default_optimisation_attrs(&self, _llfn: Self::Function) {}
32 fn declare_c_main(&self, fn_type: Self::FunctionSignature) -> Option<Self::Function>;
35
36 fn intrinsic_call_expects_place_always(&self, name: Intrinsic) -> bool;
41}