Implement BackendTypes for FunctionCx

This commit is contained in:
bjorn3 2018-11-21 16:01:33 +01:00
parent 6559029b9d
commit 830522af6d
2 changed files with 13 additions and 1 deletions

View File

@ -1,5 +1,6 @@
use std::fmt;
use rustc_codegen_ssa::traits::BackendTypes;
use rustc_target::spec::{HasTargetSpec, Target};
use cranelift_module::Module;
@ -667,6 +668,15 @@ fn target_spec(&self) -> &Target {
}
}
impl<'a, 'tcx, B: Backend> BackendTypes for FunctionCx<'a, 'tcx, B> {
type Value = Value;
type BasicBlock = Ebb;
type Type = Type;
type Context = !;
type Funclet = !;
type DIScope = !;
}
impl<'a, 'tcx: 'a, B: Backend + 'a> FunctionCx<'a, 'tcx, B> {
pub fn monomorphize<T>(&self, value: &T) -> T
where

View File

@ -76,7 +76,6 @@ mod prelude {
self, subst::Substs, FnSig, Instance, InstanceDef, ParamEnv, PolyFnSig, Ty, TyCtxt,
TypeAndMut, TypeFoldable,
};
pub use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleKind};
pub use rustc_data_structures::{
fx::{FxHashMap, FxHashSet},
indexed_vec::Idx,
@ -84,6 +83,9 @@ mod prelude {
};
pub use rustc_mir::monomorphize::{collector, MonoItem};
pub use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleKind};
pub use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
pub use cranelift::codegen::ir::{
condcodes::IntCC, function::Function, ExternalName, FuncRef, Inst, StackSlot,
};