diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2019-12-24 12:40:18 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2019-12-24 12:43:20 +0100 |
| commit | 399cada762d5c2f8cdedb9efa8e7e7fb8059cd85 (patch) | |
| tree | 95ec8732232eda9dd00bd90c8add250dd88a9bb6 /src | |
| parent | 047eaf14ba7306511cf350d079c912ff840c566d (diff) | |
| download | rust-399cada762d5c2f8cdedb9efa8e7e7fb8059cd85.tar.gz rust-399cada762d5c2f8cdedb9efa8e7e7fb8059cd85.zip | |
Directly depend on cranelift_{codegen,frontend}
Fixes #838
Diffstat (limited to 'src')
| -rw-r--r-- | src/abi/mod.rs | 2 | ||||
| -rw-r--r-- | src/base.rs | 6 | ||||
| -rw-r--r-- | src/common.rs | 2 | ||||
| -rw-r--r-- | src/debuginfo/line_info.rs | 4 | ||||
| -rw-r--r-- | src/debuginfo/mod.rs | 10 | ||||
| -rw-r--r-- | src/intrinsics/mod.rs | 4 | ||||
| -rw-r--r-- | src/lib.rs | 19 | ||||
| -rw-r--r-- | src/pointer.rs | 2 | ||||
| -rw-r--r-- | src/pretty_clif.rs | 6 | ||||
| -rw-r--r-- | src/value_and_place.rs | 6 |
10 files changed, 33 insertions, 28 deletions
diff --git a/src/abi/mod.rs b/src/abi/mod.rs index 087cced93a3..9911f20655c 100644 --- a/src/abi/mod.rs +++ b/src/abi/mod.rs @@ -5,6 +5,8 @@ mod returning; use rustc_target::spec::abi::Abi; +use cranelift_codegen::ir::AbiParam; + use self::pass_mode::*; use crate::prelude::*; diff --git a/src/base.rs b/src/base.rs index 8bc5525160d..8cb3c2d150e 100644 --- a/src/base.rs +++ b/src/base.rs @@ -103,11 +103,11 @@ pub fn trans_fn<'clif, 'tcx, B: Backend + 'static>( fn verify_func(tcx: TyCtxt, writer: &crate::pretty_clif::CommentWriter, func: &Function) { let flags = settings::Flags::new(settings::builder()); - match ::cranelift::codegen::verify_function(&func, &flags) { + match ::cranelift_codegen::verify_function(&func, &flags) { Ok(_) => {} Err(err) => { tcx.sess.err(&format!("{:?}", err)); - let pretty_error = ::cranelift::codegen::print_errors::pretty_verifier_error( + let pretty_error = ::cranelift_codegen::print_errors::pretty_verifier_error( &func, None, Some(Box::new(writer)), @@ -195,7 +195,7 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, impl Backend>) { targets, } => { let discr = trans_operand(fx, discr).load_scalar(fx); - let mut switch = ::cranelift::frontend::Switch::new(); + let mut switch = ::cranelift_frontend::Switch::new(); for (i, value) in values.iter().enumerate() { let ebb = fx.get_ebb(targets[i]); switch.set_entry(*value as u64, ebb); diff --git a/src/common.rs b/src/common.rs index d0c3385df6c..9506d4b5224 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1,7 +1,7 @@ use rustc::ty::layout::{Integer, Primitive}; use rustc_target::spec::{HasTargetSpec, Target}; -use cranelift::codegen::ir::{InstructionData, Opcode, ValueDef}; +use cranelift_codegen::ir::{InstructionData, Opcode, ValueDef}; use crate::prelude::*; diff --git a/src/debuginfo/line_info.rs b/src/debuginfo/line_info.rs index e21b0b026c8..63acb3b4e8f 100644 --- a/src/debuginfo/line_info.rs +++ b/src/debuginfo/line_info.rs @@ -5,7 +5,7 @@ use crate::prelude::*; use syntax::source_map::FileName; -use cranelift::codegen::binemit::CodeOffset; +use cranelift_codegen::binemit::CodeOffset; use gimli::write::{ Address, AttributeValue, FileId, LineProgram, LineString, LineStringTable, UnitEntryId, @@ -104,7 +104,7 @@ impl<'a, 'tcx> FunctionDebugContext<'a, 'tcx> { pub(crate) fn create_debug_lines( &mut self, context: &Context, - isa: &dyn cranelift::codegen::isa::TargetIsa, + isa: &dyn cranelift_codegen::isa::TargetIsa, source_info_set: &indexmap::IndexSet<(Span, mir::SourceScope)>, ) -> CodeOffset { let tcx = self.debug_context.tcx; diff --git a/src/debuginfo/mod.rs b/src/debuginfo/mod.rs index 2e40e7c4cad..3d4e200f00c 100644 --- a/src/debuginfo/mod.rs +++ b/src/debuginfo/mod.rs @@ -3,9 +3,9 @@ mod line_info; use crate::prelude::*; -use cranelift::codegen::ir::{StackSlots, ValueLabel, ValueLoc}; -use cranelift::codegen::isa::RegUnit; -use cranelift::codegen::ValueLocRange; +use cranelift_codegen::ir::{StackSlots, ValueLabel, ValueLoc}; +use cranelift_codegen::isa::RegUnit; +use cranelift_codegen::ValueLocRange; use gimli::write::{ self, Address, AttributeValue, DwarfUnit, Expression, LineProgram, LineString, Location, @@ -253,7 +253,7 @@ impl<'a, 'tcx> FunctionDebugContext<'a, 'tcx> { pub fn define( &mut self, context: &Context, - isa: &dyn cranelift::codegen::isa::TargetIsa, + isa: &dyn cranelift_codegen::isa::TargetIsa, source_info_set: &indexmap::IndexSet<(Span, mir::SourceScope)>, local_map: HashMap<mir::Local, CPlace<'tcx>>, ) { @@ -312,7 +312,7 @@ fn place_location<'a, 'tcx>( match cplace.inner() { CPlaceInner::Var(local) => { - let value_label = cranelift::codegen::ir::ValueLabel::from_u32(local.as_u32()); + let value_label = cranelift_codegen::ir::ValueLabel::from_u32(local.as_u32()); if let Some(value_loc_ranges) = value_labels_ranges.get(&value_label) { let loc_list = LocationList( value_loc_ranges diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs index ca10399cb9c..2e1584e3efa 100644 --- a/src/intrinsics/mod.rs +++ b/src/intrinsics/mod.rs @@ -633,7 +633,7 @@ pub fn codegen_intrinsic_call<'tcx>( } _ => panic!("clif_type returned {}", clif_ty), }; - fx.bcx.set_val_label(val, cranelift::codegen::ir::ValueLabel::from_u32(var.as_u32())); + fx.bcx.set_val_label(val, cranelift_codegen::ir::ValueLabel::from_u32(var.as_u32())); fx.bcx.def_var(mir_var(var), val); } _ => { @@ -670,7 +670,7 @@ pub fn codegen_intrinsic_call<'tcx>( } _ => panic!("clif_type returned {}", clif_ty), }; - fx.bcx.set_val_label(val, cranelift::codegen::ir::ValueLabel::from_u32(var.as_u32())); + fx.bcx.set_val_label(val, cranelift_codegen::ir::ValueLabel::from_u32(var.as_u32())); fx.bcx.def_var(mir_var(var), val); } CPlaceInner::Addr(_, _) => { diff --git a/src/lib.rs b/src/lib.rs index 7d67de73ae2..9337d07ffc7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,7 +25,7 @@ use rustc::ty::query::Providers; use rustc::util::common::ErrorReported; use rustc_codegen_utils::codegen_backend::CodegenBackend; -use cranelift::codegen::settings; +use cranelift_codegen::settings; use crate::constant::ConstantCx; use crate::prelude::*; @@ -91,12 +91,15 @@ mod prelude { pub use rustc_codegen_ssa::traits::*; pub use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleKind}; - pub use cranelift::codegen::ir::{ - condcodes::IntCC, function::Function, ExternalName, FuncRef, Inst, SourceLoc, StackSlot, - }; - pub use cranelift::codegen::isa::CallConv; - pub use cranelift::codegen::Context; - pub use cranelift::prelude::*; + pub use cranelift_codegen::Context; + pub use cranelift_codegen::ir::{AbiParam, Ebb, ExternalName, FuncRef, Inst, InstBuilder, MemFlags, Signature, SourceLoc, StackSlot, StackSlotData, StackSlotKind, TrapCode, Type, Value}; + pub use cranelift_codegen::ir::condcodes::{FloatCC, IntCC}; + pub use cranelift_codegen::ir::function::Function; + pub use cranelift_codegen::ir::immediates::{Ieee32, Ieee64}; + pub use cranelift_codegen::ir::types; + pub use cranelift_codegen::isa::{self, CallConv}; + pub use cranelift_codegen::settings::{self, Configurable}; + pub use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext, Variable}; pub use cranelift_module::{ self, Backend, DataContext, DataId, FuncId, FuncOrDataId, Linkage, Module, }; @@ -283,7 +286,7 @@ fn build_isa(sess: &Session, enable_pic: bool) -> Box<dyn isa::TargetIsa + 'stat let target_triple = crate::target_triple(sess); let flags = settings::Flags::new(flags_builder); - cranelift::codegen::isa::lookup(target_triple) + cranelift_codegen::isa::lookup(target_triple) .unwrap() .finish(flags) } diff --git a/src/pointer.rs b/src/pointer.rs index f47d5e9be9b..7483d4cc6a5 100644 --- a/src/pointer.rs +++ b/src/pointer.rs @@ -1,6 +1,6 @@ use crate::prelude::*; -use cranelift::codegen::ir::immediates::Offset32; +use cranelift_codegen::ir::immediates::Offset32; #[derive(Copy, Clone, Debug)] pub struct Pointer { diff --git a/src/pretty_clif.rs b/src/pretty_clif.rs index 97bb2e0caec..5f3ebfc4bef 100644 --- a/src/pretty_clif.rs +++ b/src/pretty_clif.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use std::collections::HashMap; use std::fmt; -use cranelift::codegen::{ +use cranelift_codegen::{ entity::SecondaryMap, ir::{self, entities::AnyEntity, function::DisplayFunctionAnnotations}, write::{FuncWriter, PlainWriter}, @@ -221,7 +221,7 @@ pub fn write_clif_file<'tcx>( ); let mut clif = String::new(); - cranelift::codegen::write::decorate_function( + cranelift_codegen::write::decorate_function( &mut clif_comments, &mut clif, &func, @@ -255,7 +255,7 @@ impl<'a, 'tcx, B: Backend + 'static> fmt::Debug for FunctionCx<'_, 'tcx, B> { writeln!(f, "{:?}", self.local_map)?; let mut clif = String::new(); - ::cranelift::codegen::write::decorate_function( + ::cranelift_codegen::write::decorate_function( &mut &self.clif_comments, &mut clif, &self.bcx.func, diff --git a/src/value_and_place.rs b/src/value_and_place.rs index b1e96d2ce2c..df59fb8302c 100644 --- a/src/value_and_place.rs +++ b/src/value_and_place.rs @@ -1,6 +1,6 @@ use crate::prelude::*; -use cranelift::codegen::ir::immediates::Offset32; +use cranelift_codegen::ir::immediates::Offset32; fn codegen_field<'tcx>( fx: &mut FunctionCx<'_, 'tcx, impl Backend>, @@ -308,7 +308,7 @@ impl<'tcx> CPlace<'tcx> { match self.inner { CPlaceInner::Var(var) => { let val = fx.bcx.use_var(mir_var(var)); - fx.bcx.set_val_label(val, cranelift::codegen::ir::ValueLabel::from_u32(var.as_u32())); + fx.bcx.set_val_label(val, cranelift_codegen::ir::ValueLabel::from_u32(var.as_u32())); CValue::by_val(val, layout) } CPlaceInner::Addr(ptr, extra) => { @@ -415,7 +415,7 @@ impl<'tcx> CPlace<'tcx> { let to_ptr = match self.inner { CPlaceInner::Var(var) => { let data = from.load_scalar(fx); - fx.bcx.set_val_label(data, cranelift::codegen::ir::ValueLabel::from_u32(var.as_u32())); + fx.bcx.set_val_label(data, cranelift_codegen::ir::ValueLabel::from_u32(var.as_u32())); fx.bcx.def_var(mir_var(var), data); return; } |
