Rustup to rustc 1.37.0-nightly (2887008e0
2019-06-12)
This commit is contained in:
parent
5e2ea4f194
commit
6d1bc088a7
10 changed files with 44 additions and 44 deletions
14
src/abi.rs
14
src/abi.rs
|
@ -39,8 +39,8 @@ pub fn scalar_to_clif_type(tcx: TyCtxt, scalar: Scalar) -> Type {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_pass_mode<'a, 'tcx: 'a>(
|
fn get_pass_mode<'tcx>(
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
ty: Ty<'tcx>,
|
ty: Ty<'tcx>,
|
||||||
) -> PassMode {
|
) -> PassMode {
|
||||||
let layout = tcx.layout_of(ParamEnv::reveal_all().and(ty)).unwrap();
|
let layout = tcx.layout_of(ParamEnv::reveal_all().and(ty)).unwrap();
|
||||||
|
@ -76,7 +76,7 @@ fn adjust_arg_for_abi<'a, 'tcx: 'a>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn clif_sig_from_fn_sig<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, sig: FnSig<'tcx>) -> Signature {
|
fn clif_sig_from_fn_sig<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, sig: FnSig<'tcx>) -> Signature {
|
||||||
let (call_conv, inputs, output): (CallConv, Vec<Ty>, Ty) = match sig.abi {
|
let (call_conv, inputs, output): (CallConv, Vec<Ty>, Ty) = match sig.abi {
|
||||||
Abi::Rust => (CallConv::SystemV, sig.inputs().to_vec(), sig.output()),
|
Abi::Rust => (CallConv::SystemV, sig.inputs().to_vec(), sig.output()),
|
||||||
Abi::C => (CallConv::SystemV, sig.inputs().to_vec(), sig.output()),
|
Abi::C => (CallConv::SystemV, sig.inputs().to_vec(), sig.output()),
|
||||||
|
@ -128,8 +128,8 @@ fn clif_sig_from_fn_sig<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, sig: FnSig<'t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_function_name_and_sig<'a, 'tcx>(
|
pub fn get_function_name_and_sig<'tcx>(
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
inst: Instance<'tcx>,
|
inst: Instance<'tcx>,
|
||||||
support_vararg: bool,
|
support_vararg: bool,
|
||||||
) -> (String, Signature) {
|
) -> (String, Signature) {
|
||||||
|
@ -143,8 +143,8 @@ pub fn get_function_name_and_sig<'a, 'tcx>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Instance must be monomorphized
|
/// Instance must be monomorphized
|
||||||
pub fn import_function<'a, 'tcx: 'a>(
|
pub fn import_function<'tcx>(
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
module: &mut Module<impl Backend>,
|
module: &mut Module<impl Backend>,
|
||||||
inst: Instance<'tcx>,
|
inst: Instance<'tcx>,
|
||||||
) -> FuncId {
|
) -> FuncId {
|
||||||
|
|
|
@ -3,7 +3,7 @@ use rustc::ty::adjustment::PointerCast;
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
|
||||||
pub fn trans_fn<'a, 'clif, 'tcx: 'a, B: Backend + 'static>(
|
pub fn trans_fn<'a, 'clif, 'tcx: 'a, B: Backend + 'static>(
|
||||||
cx: &mut crate::CodegenCx<'a, 'clif, 'tcx, B>,
|
cx: &mut crate::CodegenCx<'clif, 'tcx, B>,
|
||||||
instance: Instance<'tcx>,
|
instance: Instance<'tcx>,
|
||||||
linkage: Linkage,
|
linkage: Linkage,
|
||||||
) {
|
) {
|
||||||
|
@ -18,9 +18,9 @@ pub fn trans_fn<'a, 'clif, 'tcx: 'a, B: Backend + 'static>(
|
||||||
// Check sig for u128 and i128
|
// Check sig for u128 and i128
|
||||||
let fn_sig = tcx.normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), &instance.fn_sig(tcx));
|
let fn_sig = tcx.normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), &instance.fn_sig(tcx));
|
||||||
|
|
||||||
struct UI128Visitor<'a, 'tcx: 'a>(TyCtxt<'a, 'tcx, 'tcx>, bool);
|
struct UI128Visitor<'tcx>(TyCtxt<'tcx, 'tcx>, bool);
|
||||||
|
|
||||||
impl<'a, 'tcx: 'a> rustc::ty::fold::TypeVisitor<'tcx> for UI128Visitor<'a, 'tcx> {
|
impl<'tcx> rustc::ty::fold::TypeVisitor<'tcx> for UI128Visitor<'tcx> {
|
||||||
fn visit_ty(&mut self, t: Ty<'tcx>) -> bool {
|
fn visit_ty(&mut self, t: Ty<'tcx>) -> bool {
|
||||||
if t.sty == self.0.types.u128.sty || t.sty == self.0.types.i128.sty {
|
if t.sty == self.0.types.u128.sty || t.sty == self.0.types.i128.sty {
|
||||||
self.1 = true;
|
self.1 = true;
|
||||||
|
|
|
@ -18,7 +18,7 @@ pub fn pointer_ty(tcx: TyCtxt) -> types::Type {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn clif_type_from_ty<'a, 'tcx: 'a>(
|
pub fn clif_type_from_ty<'a, 'tcx: 'a>(
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
ty: Ty<'tcx>,
|
ty: Ty<'tcx>,
|
||||||
) -> Option<types::Type> {
|
) -> Option<types::Type> {
|
||||||
Some(match ty.sty {
|
Some(match ty.sty {
|
||||||
|
@ -95,7 +95,7 @@ pub fn clif_intcast<'a, 'tcx: 'a>(
|
||||||
|
|
||||||
pub struct FunctionCx<'a, 'tcx: 'a, B: Backend> {
|
pub struct FunctionCx<'a, 'tcx: 'a, B: Backend> {
|
||||||
// FIXME use a reference to `CodegenCx` instead of `tcx`, `module` and `constants` and `caches`
|
// FIXME use a reference to `CodegenCx` instead of `tcx`, `module` and `constants` and `caches`
|
||||||
pub tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
pub tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
pub module: &'a mut Module<B>,
|
pub module: &'a mut Module<B>,
|
||||||
pub pointer_type: Type, // Cached from module
|
pub pointer_type: Type, // Cached from module
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ impl<'a, 'tcx: 'a, B: Backend> LayoutOf for FunctionCx<'a, 'tcx, B> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'tcx, B: Backend + 'a> layout::HasTyCtxt<'tcx> for FunctionCx<'a, 'tcx, B> {
|
impl<'a, 'tcx, B: Backend + 'a> layout::HasTyCtxt<'tcx> for FunctionCx<'a, 'tcx, B> {
|
||||||
fn tcx<'b>(&'b self) -> TyCtxt<'b, 'tcx, 'tcx> {
|
fn tcx<'b>(&'b self) -> TyCtxt<'tcx, 'tcx> {
|
||||||
self.tcx
|
self.tcx
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ enum TodoItem {
|
||||||
impl ConstantCx {
|
impl ConstantCx {
|
||||||
pub fn finalize<'a, 'tcx: 'a, B: Backend>(
|
pub fn finalize<'a, 'tcx: 'a, B: Backend>(
|
||||||
mut self,
|
mut self,
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
module: &mut Module<B>,
|
module: &mut Module<B>,
|
||||||
) {
|
) {
|
||||||
//println!("todo {:?}", self.todo);
|
//println!("todo {:?}", self.todo);
|
||||||
|
@ -184,7 +184,7 @@ fn data_id_for_alloc_id<B: Backend>(module: &mut Module<B>, alloc_id: AllocId) -
|
||||||
}
|
}
|
||||||
|
|
||||||
fn data_id_for_static<'a, 'tcx: 'a, B: Backend>(
|
fn data_id_for_static<'a, 'tcx: 'a, B: Backend>(
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
module: &mut Module<B>,
|
module: &mut Module<B>,
|
||||||
def_id: DefId,
|
def_id: DefId,
|
||||||
linkage: Linkage,
|
linkage: Linkage,
|
||||||
|
@ -238,7 +238,7 @@ fn cplace_for_dataid<'a, 'tcx: 'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn define_all_allocs<'a, 'tcx: 'a, B: Backend + 'a>(
|
fn define_all_allocs<'a, 'tcx: 'a, B: Backend + 'a>(
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
module: &mut Module<B>,
|
module: &mut Module<B>,
|
||||||
cx: &mut ConstantCx,
|
cx: &mut ConstantCx,
|
||||||
) {
|
) {
|
||||||
|
@ -336,7 +336,7 @@ fn pop_set<T: Copy + Eq + ::std::hash::Hash>(set: &mut HashSet<T>) -> Option<T>
|
||||||
|
|
||||||
struct TransPlaceInterpreter;
|
struct TransPlaceInterpreter;
|
||||||
|
|
||||||
impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter {
|
impl<'mir, 'tcx> Machine<'mir, 'tcx> for TransPlaceInterpreter {
|
||||||
type MemoryKinds = !;
|
type MemoryKinds = !;
|
||||||
type PointerTag = ();
|
type PointerTag = ();
|
||||||
type AllocExtra = ();
|
type AllocExtra = ();
|
||||||
|
@ -345,16 +345,16 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter {
|
||||||
type MemoryMap = FxHashMap<AllocId, (MemoryKind<!>, Allocation<()>)>;
|
type MemoryMap = FxHashMap<AllocId, (MemoryKind<!>, Allocation<()>)>;
|
||||||
const STATIC_KIND: Option<!> = None;
|
const STATIC_KIND: Option<!> = None;
|
||||||
|
|
||||||
fn enforce_validity(_: &InterpretCx<'a, 'mir, 'tcx, Self>) -> bool {
|
fn enforce_validity(_: &InterpretCx<'mir, 'tcx, Self>) -> bool {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
fn before_terminator(_: &mut InterpretCx<'a, 'mir, 'tcx, Self>) -> InterpResult<'tcx> {
|
fn before_terminator(_: &mut InterpretCx<'mir, 'tcx, Self>) -> InterpResult<'tcx> {
|
||||||
panic!();
|
panic!();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn find_fn(
|
fn find_fn(
|
||||||
_: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
|
_: &mut InterpretCx<'mir, 'tcx, Self>,
|
||||||
_: Instance<'tcx>,
|
_: Instance<'tcx>,
|
||||||
_: &[OpTy<'tcx>],
|
_: &[OpTy<'tcx>],
|
||||||
_: Option<PlaceTy<'tcx>>,
|
_: Option<PlaceTy<'tcx>>,
|
||||||
|
@ -364,7 +364,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn call_intrinsic(
|
fn call_intrinsic(
|
||||||
_: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
|
_: &mut InterpretCx<'mir, 'tcx, Self>,
|
||||||
_: Instance<'tcx>,
|
_: Instance<'tcx>,
|
||||||
_: &[OpTy<'tcx>],
|
_: &[OpTy<'tcx>],
|
||||||
_: PlaceTy<'tcx>,
|
_: PlaceTy<'tcx>,
|
||||||
|
@ -374,13 +374,13 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter {
|
||||||
|
|
||||||
fn find_foreign_static(
|
fn find_foreign_static(
|
||||||
_: DefId,
|
_: DefId,
|
||||||
_: ::rustc::ty::query::TyCtxtAt<'a, 'tcx, 'tcx>,
|
_: ::rustc::ty::query::TyCtxtAt<'tcx, 'tcx>,
|
||||||
) -> InterpResult<'tcx, Cow<'tcx, Allocation>> {
|
) -> InterpResult<'tcx, Cow<'tcx, Allocation>> {
|
||||||
panic!();
|
panic!();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ptr_op(
|
fn ptr_op(
|
||||||
_: &InterpretCx<'a, 'mir, 'tcx, Self>,
|
_: &InterpretCx<'mir, 'tcx, Self>,
|
||||||
_: mir::BinOp,
|
_: mir::BinOp,
|
||||||
_: ImmTy<'tcx>,
|
_: ImmTy<'tcx>,
|
||||||
_: ImmTy<'tcx>,
|
_: ImmTy<'tcx>,
|
||||||
|
@ -388,7 +388,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter {
|
||||||
panic!();
|
panic!();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn box_alloc(_: &mut InterpretCx<'a, 'mir, 'tcx, Self>, _: PlaceTy<'tcx>) -> InterpResult<'tcx> {
|
fn box_alloc(_: &mut InterpretCx<'mir, 'tcx, Self>, _: PlaceTy<'tcx>) -> InterpResult<'tcx> {
|
||||||
panic!();
|
panic!();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,11 +405,11 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter {
|
||||||
()
|
()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn stack_push(_: &mut InterpretCx<'a, 'mir, 'tcx, Self>) -> InterpResult<'tcx> {
|
fn stack_push(_: &mut InterpretCx<'mir, 'tcx, Self>) -> InterpResult<'tcx> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn stack_pop(_: &mut InterpretCx<'a, 'mir, 'tcx, Self>, _: ()) -> InterpResult<'tcx> {
|
fn stack_pop(_: &mut InterpretCx<'mir, 'tcx, Self>, _: ()) -> InterpResult<'tcx> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ impl<'a, 'tcx: 'a> DebugContext<'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn emit_location(&mut self, tcx: TyCtxt<'a, 'tcx, 'tcx>, entry_id: UnitEntryId, span: Span) {
|
fn emit_location(&mut self, tcx: TyCtxt<'tcx, 'tcx>, entry_id: UnitEntryId, span: Span) {
|
||||||
let loc = tcx.sess.source_map().lookup_char_pos(span.lo());
|
let loc = tcx.sess.source_map().lookup_char_pos(span.lo());
|
||||||
|
|
||||||
let file_id = line_program_add_file(
|
let file_id = line_program_add_file(
|
||||||
|
@ -232,7 +232,7 @@ pub struct FunctionDebugContext<'a, 'tcx> {
|
||||||
|
|
||||||
impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> {
|
impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
tcx: TyCtxt<'b, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
debug_context: &'a mut DebugContext<'tcx>,
|
debug_context: &'a mut DebugContext<'tcx>,
|
||||||
mir: &Body,
|
mir: &Body,
|
||||||
name: &str,
|
name: &str,
|
||||||
|
|
|
@ -14,7 +14,7 @@ use cranelift_faerie::*;
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
|
||||||
pub fn codegen_crate<'a, 'tcx>(
|
pub fn codegen_crate<'a, 'tcx>(
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
metadata: EncodedMetadata,
|
metadata: EncodedMetadata,
|
||||||
need_metadata_module: bool,
|
need_metadata_module: bool,
|
||||||
) -> Box<dyn Any> {
|
) -> Box<dyn Any> {
|
||||||
|
@ -45,7 +45,7 @@ pub fn codegen_crate<'a, 'tcx>(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
fn run_jit<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, log: &mut Option<File>) -> ! {
|
fn run_jit<'a, 'tcx: 'a>(tcx: TyCtxt<'tcx, 'tcx>, log: &mut Option<File>) -> ! {
|
||||||
use cranelift_simplejit::{SimpleJITBackend, SimpleJITBuilder};
|
use cranelift_simplejit::{SimpleJITBackend, SimpleJITBuilder};
|
||||||
|
|
||||||
let mut jit_module: Module<SimpleJITBackend> = Module::new(SimpleJITBuilder::new(
|
let mut jit_module: Module<SimpleJITBackend> = Module::new(SimpleJITBuilder::new(
|
||||||
|
@ -96,7 +96,7 @@ fn run_jit<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, log: &mut Option<File>) ->
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run_aot<'a, 'tcx: 'a>(
|
fn run_aot<'a, 'tcx: 'a>(
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
metadata: EncodedMetadata,
|
metadata: EncodedMetadata,
|
||||||
need_metadata_module: bool,
|
need_metadata_module: bool,
|
||||||
log: &mut Option<File>,
|
log: &mut Option<File>,
|
||||||
|
@ -225,7 +225,7 @@ fn run_aot<'a, 'tcx: 'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn codegen_cgus<'a, 'tcx: 'a>(
|
fn codegen_cgus<'a, 'tcx: 'a>(
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
module: &mut Module<impl Backend + 'static>,
|
module: &mut Module<impl Backend + 'static>,
|
||||||
debug: &mut Option<DebugContext<'tcx>>,
|
debug: &mut Option<DebugContext<'tcx>>,
|
||||||
log: &mut Option<File>,
|
log: &mut Option<File>,
|
||||||
|
@ -243,7 +243,7 @@ fn codegen_cgus<'a, 'tcx: 'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn codegen_mono_items<'a, 'tcx: 'a>(
|
fn codegen_mono_items<'a, 'tcx: 'a>(
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
module: &mut Module<impl Backend + 'static>,
|
module: &mut Module<impl Backend + 'static>,
|
||||||
debug_context: Option<&mut DebugContext<'tcx>>,
|
debug_context: Option<&mut DebugContext<'tcx>>,
|
||||||
log: &mut Option<File>,
|
log: &mut Option<File>,
|
||||||
|
@ -263,7 +263,7 @@ fn codegen_mono_items<'a, 'tcx: 'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn trans_mono_item<'a, 'clif, 'tcx: 'a, B: Backend + 'static>(
|
fn trans_mono_item<'a, 'clif, 'tcx: 'a, B: Backend + 'static>(
|
||||||
cx: &mut crate::CodegenCx<'a, 'clif, 'tcx, B>,
|
cx: &mut crate::CodegenCx<'clif, 'tcx, B>,
|
||||||
mono_item: MonoItem<'tcx>,
|
mono_item: MonoItem<'tcx>,
|
||||||
linkage: Linkage,
|
linkage: Linkage,
|
||||||
) {
|
) {
|
||||||
|
|
10
src/lib.rs
10
src/lib.rs
|
@ -122,17 +122,17 @@ impl<'tcx> Default for Caches<'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct CodegenCx<'a, 'clif, 'tcx, B: Backend + 'static> {
|
pub struct CodegenCx<'clif, 'tcx, B: Backend + 'static> {
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
module: &'clif mut Module<B>,
|
module: &'clif mut Module<B>,
|
||||||
ccx: ConstantCx,
|
ccx: ConstantCx,
|
||||||
caches: Caches<'tcx>,
|
caches: Caches<'tcx>,
|
||||||
debug_context: Option<&'clif mut DebugContext<'tcx>>,
|
debug_context: Option<&'clif mut DebugContext<'tcx>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'clif, 'tcx, B: Backend + 'static> CodegenCx<'a, 'clif, 'tcx, B> {
|
impl<'clif, 'tcx, B: Backend + 'static> CodegenCx<'clif, 'tcx, B> {
|
||||||
fn new(
|
fn new(
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
module: &'clif mut Module<B>,
|
module: &'clif mut Module<B>,
|
||||||
debug_context: Option<&'clif mut DebugContext<'tcx>>,
|
debug_context: Option<&'clif mut DebugContext<'tcx>>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
|
@ -195,7 +195,7 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
||||||
|
|
||||||
fn codegen_crate<'a, 'tcx>(
|
fn codegen_crate<'a, 'tcx>(
|
||||||
&self,
|
&self,
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
metadata: EncodedMetadata,
|
metadata: EncodedMetadata,
|
||||||
need_metadata_module: bool,
|
need_metadata_module: bool,
|
||||||
_rx: mpsc::Receiver<Box<dyn Any + Send>>,
|
_rx: mpsc::Receiver<Box<dyn Any + Send>>,
|
||||||
|
|
|
@ -3,7 +3,7 @@ use crate::prelude::*;
|
||||||
/// Create the `main` function which will initialize the rust runtime and call
|
/// Create the `main` function which will initialize the rust runtime and call
|
||||||
/// users main function.
|
/// users main function.
|
||||||
pub fn maybe_create_entry_wrapper<'a, 'tcx: 'a>(
|
pub fn maybe_create_entry_wrapper<'a, 'tcx: 'a>(
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
module: &mut Module<impl Backend + 'static>,
|
module: &mut Module<impl Backend + 'static>,
|
||||||
) {
|
) {
|
||||||
use rustc::middle::lang_items::StartFnLangItem;
|
use rustc::middle::lang_items::StartFnLangItem;
|
||||||
|
@ -23,7 +23,7 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx: 'a>(
|
||||||
create_entry_fn(tcx, module, main_def_id, use_start_lang_item);;
|
create_entry_fn(tcx, module, main_def_id, use_start_lang_item);;
|
||||||
|
|
||||||
fn create_entry_fn<'a, 'tcx: 'a>(
|
fn create_entry_fn<'a, 'tcx: 'a>(
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
m: &mut Module<impl Backend + 'static>,
|
m: &mut Module<impl Backend + 'static>,
|
||||||
rust_main_def_id: DefId,
|
rust_main_def_id: DefId,
|
||||||
use_start_lang_item: bool,
|
use_start_lang_item: bool,
|
||||||
|
|
|
@ -49,7 +49,7 @@ impl MetadataLoader for CraneliftMetadataLoader {
|
||||||
|
|
||||||
// Adapted from https://github.com/rust-lang/rust/blob/da573206f87b5510de4b0ee1a9c044127e409bd3/src/librustc_codegen_llvm/base.rs#L47-L112
|
// Adapted from https://github.com/rust-lang/rust/blob/da573206f87b5510de4b0ee1a9c044127e409bd3/src/librustc_codegen_llvm/base.rs#L47-L112
|
||||||
pub fn write_metadata<'a, 'gcx>(
|
pub fn write_metadata<'a, 'gcx>(
|
||||||
tcx: TyCtxt<'a, 'gcx, 'gcx>,
|
tcx: TyCtxt<'gcx, 'gcx>,
|
||||||
artifact: &mut faerie::Artifact
|
artifact: &mut faerie::Artifact
|
||||||
) -> EncodedMetadata {
|
) -> EncodedMetadata {
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
|
@ -77,7 +77,7 @@ pub struct CommentWriter {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CommentWriter {
|
impl CommentWriter {
|
||||||
pub fn new<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, instance: Instance<'tcx>) -> Self {
|
pub fn new<'a, 'tcx: 'a>(tcx: TyCtxt<'tcx, 'tcx>, instance: Instance<'tcx>) -> Self {
|
||||||
CommentWriter {
|
CommentWriter {
|
||||||
global_comments: vec![
|
global_comments: vec![
|
||||||
format!("symbol {}", tcx.symbol_name(instance).as_str()),
|
format!("symbol {}", tcx.symbol_name(instance).as_str()),
|
||||||
|
@ -194,7 +194,7 @@ impl<'a, 'tcx: 'a, B: Backend + 'a> FunctionCx<'a, 'tcx, B> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_clif_file<'a, 'tcx: 'a>(
|
pub fn write_clif_file<'a, 'tcx: 'a>(
|
||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx, 'tcx>,
|
||||||
postfix: &str,
|
postfix: &str,
|
||||||
instance: Instance<'tcx>,
|
instance: Instance<'tcx>,
|
||||||
func: &ir::Function,
|
func: &ir::Function,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue