]> git.lizzy.rs Git - rust.git/blob - src/librustc_codegen_ssa/traits/misc.rs
Rollup merge of #70038 - DutchGhost:const-forget-tests, r=RalfJung
[rust.git] / src / librustc_codegen_ssa / traits / misc.rs
1 use super::BackendTypes;
2 use rustc::mir::mono::CodegenUnit;
3 use rustc::ty::{self, Instance, Ty};
4 use rustc_data_structures::fx::FxHashMap;
5 use rustc_session::Session;
6 use std::cell::RefCell;
7 use std::sync::Arc;
8
9 pub trait MiscMethods<'tcx>: BackendTypes {
10     fn vtables(
11         &self,
12     ) -> &RefCell<FxHashMap<(Ty<'tcx>, Option<ty::PolyExistentialTraitRef<'tcx>>), Self::Value>>;
13     fn check_overflow(&self) -> bool;
14     fn get_fn(&self, instance: Instance<'tcx>) -> Self::Function;
15     fn get_fn_addr(&self, instance: Instance<'tcx>) -> Self::Value;
16     fn eh_personality(&self) -> Self::Value;
17     fn sess(&self) -> &Session;
18     fn codegen_unit(&self) -> &Arc<CodegenUnit<'tcx>>;
19     fn used_statics(&self) -> &RefCell<Vec<Self::Value>>;
20     fn set_frame_pointer_elimination(&self, llfn: Self::Function);
21     fn apply_target_cpu_attr(&self, llfn: Self::Function);
22     fn create_used_variable(&self);
23 }