Use BackendTypes instead of Backend or HasCodegen in a few places
This commit is contained in:
parent
66c3195c4c
commit
187c4cf257
7 changed files with 18 additions and 18 deletions
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use super::HasCodegen;
|
||||
use super::BackendTypes;
|
||||
use rustc::ty::{FnSig, Instance, Ty};
|
||||
use rustc_target::abi::call::FnType;
|
||||
|
||||
|
@ -18,6 +18,6 @@ pub trait AbiMethods<'tcx> {
|
|||
fn fn_type_of_instance(&self, instance: &Instance<'tcx>) -> FnType<'tcx, Ty<'tcx>>;
|
||||
}
|
||||
|
||||
pub trait AbiBuilderMethods<'tcx>: HasCodegen<'tcx> {
|
||||
pub trait AbiBuilderMethods<'tcx>: BackendTypes {
|
||||
fn apply_attrs_callsite(&mut self, ty: &FnType<'tcx, Ty<'tcx>>, callsite: Self::Value);
|
||||
}
|
||||
|
|
|
@ -8,13 +8,12 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use super::Backend;
|
||||
use super::HasCodegen;
|
||||
use super::BackendTypes;
|
||||
use mir::place::PlaceRef;
|
||||
use rustc::hir::{GlobalAsm, InlineAsm};
|
||||
|
||||
pub trait AsmBuilderMethods<'tcx>: HasCodegen<'tcx> {
|
||||
// Take an inline assembly expression and splat it out via LLVM
|
||||
pub trait AsmBuilderMethods<'tcx>: BackendTypes {
|
||||
/// Take an inline assembly expression and splat it out via LLVM
|
||||
fn codegen_inline_asm(
|
||||
&mut self,
|
||||
ia: &InlineAsm,
|
||||
|
@ -23,6 +22,6 @@ pub trait AsmBuilderMethods<'tcx>: HasCodegen<'tcx> {
|
|||
) -> bool;
|
||||
}
|
||||
|
||||
pub trait AsmMethods<'tcx>: Backend<'tcx> {
|
||||
pub trait AsmMethods<'tcx> {
|
||||
fn codegen_global_asm(&self, ga: &GlobalAsm);
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use super::Backend;
|
||||
use super::HasCodegen;
|
||||
use super::BackendTypes;
|
||||
use debuginfo::{FunctionDebugContext, MirDebugScope, VariableAccess, VariableKind};
|
||||
use rustc::hir::def_id::CrateNum;
|
||||
use rustc::mir;
|
||||
|
@ -19,7 +18,7 @@ use rustc_mir::monomorphize::Instance;
|
|||
use syntax::ast::Name;
|
||||
use syntax_pos::{SourceFile, Span};
|
||||
|
||||
pub trait DebugInfoMethods<'tcx>: Backend<'tcx> {
|
||||
pub trait DebugInfoMethods<'tcx>: BackendTypes {
|
||||
fn create_vtable_metadata(&self, ty: Ty<'tcx>, vtable: Self::Value);
|
||||
|
||||
/// Creates the function-specific debug context.
|
||||
|
@ -51,7 +50,7 @@ pub trait DebugInfoMethods<'tcx>: Backend<'tcx> {
|
|||
fn debuginfo_upvar_decls_ops_sequence(&self, byte_offset_of_var_in_env: u64) -> [i64; 4];
|
||||
}
|
||||
|
||||
pub trait DebugInfoBuilderMethods<'tcx>: HasCodegen<'tcx> {
|
||||
pub trait DebugInfoBuilderMethods<'tcx>: BackendTypes {
|
||||
fn declare_local(
|
||||
&mut self,
|
||||
dbg_context: &FunctionDebugContext<Self::DIScope>,
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use super::Backend;
|
||||
use super::BackendTypes;
|
||||
use rustc::hir::def_id::DefId;
|
||||
use rustc::mir::mono::{Linkage, Visibility};
|
||||
use rustc::ty;
|
||||
use rustc_mir::monomorphize::Instance;
|
||||
|
||||
pub trait DeclareMethods<'tcx>: Backend<'tcx> {
|
||||
pub trait DeclareMethods<'tcx>: BackendTypes {
|
||||
/// Declare a global value.
|
||||
///
|
||||
/// If there’s a value with the same name already declared, the function will
|
||||
|
@ -71,7 +71,7 @@ pub trait DeclareMethods<'tcx>: Backend<'tcx> {
|
|||
fn get_defined_value(&self, name: &str) -> Option<Self::Value>;
|
||||
}
|
||||
|
||||
pub trait PreDefineMethods<'tcx>: Backend<'tcx> {
|
||||
pub trait PreDefineMethods<'tcx>: BackendTypes {
|
||||
fn predefine_static(
|
||||
&self,
|
||||
def_id: DefId,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use super::HasCodegen;
|
||||
use super::BackendTypes;
|
||||
use mir::operand::OperandRef;
|
||||
use rustc::ty::Ty;
|
||||
use rustc_target::abi::call::FnType;
|
||||
|
@ -21,7 +21,7 @@ pub enum OverflowOp {
|
|||
Mul,
|
||||
}
|
||||
|
||||
pub trait IntrinsicCallMethods<'tcx>: HasCodegen<'tcx> {
|
||||
pub trait IntrinsicCallMethods<'tcx>: BackendTypes {
|
||||
/// Remember to add all intrinsics here, in librustc_typeck/check/mod.rs,
|
||||
/// and in libcore/intrinsics.rs; if you need access to any llvm intrinsics,
|
||||
/// add them to librustc_codegen_llvm/context.rs
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use super::Backend;
|
||||
use super::BackendTypes;
|
||||
use libc::c_uint;
|
||||
use rustc::mir::mono::Stats;
|
||||
use rustc::session::Session;
|
||||
|
@ -18,7 +18,7 @@ use rustc_mir::monomorphize::partitioning::CodegenUnit;
|
|||
use std::cell::RefCell;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub trait MiscMethods<'tcx>: Backend<'tcx> {
|
||||
pub trait MiscMethods<'tcx>: BackendTypes {
|
||||
fn vtables(
|
||||
&self,
|
||||
) -> &RefCell<FxHashMap<(Ty<'tcx>, ty::PolyExistentialTraitRef<'tcx>), Self::Value>>;
|
||||
|
|
|
@ -20,6 +20,8 @@ use rustc_target::abi::call::{ArgType, CastTarget, FnType, Reg};
|
|||
use std::cell::RefCell;
|
||||
use syntax::ast;
|
||||
|
||||
// This depends on `Backend` and not `BackendTypes`, because consumers will probably want to use
|
||||
// `LayoutOf` or `HasTyCtxt`. This way, they don't have to add a constraint on it themselves.
|
||||
pub trait BaseTypeMethods<'tcx>: Backend<'tcx> {
|
||||
fn type_void(&self) -> Self::Type;
|
||||
fn type_metadata(&self) -> Self::Type;
|
||||
|
|
Loading…
Add table
Reference in a new issue