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