Skip to content

Commit

Permalink
Update Cranelift
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Mar 21, 2021
1 parent 7bd3950 commit 56fe51c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 30 deletions.
40 changes: 20 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/allocator.rs
Expand Up @@ -3,6 +3,7 @@

use crate::prelude::*;

use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
use rustc_ast::expand::allocator::{AllocatorKind, AllocatorTy, ALLOCATOR_METHODS};
use rustc_span::symbol::sym;

Expand Down Expand Up @@ -92,7 +93,7 @@ fn codegen_inner(
bcx.finalize();
}
module
.define_function(func_id, &mut ctx, &mut cranelift_codegen::binemit::NullTrapSink {})
.define_function(func_id, &mut ctx, &mut NullTrapSink {}, &mut NullStackMapSink {})
.unwrap();
unwind_context.add_function(func_id, &ctx, module.isa());
}
Expand Down Expand Up @@ -132,7 +133,7 @@ fn codegen_inner(
bcx.finalize();
}
module
.define_function(func_id, &mut ctx, &mut cranelift_codegen::binemit::NullTrapSink {})
.define_function(func_id, &mut ctx, &mut NullTrapSink {}, &mut NullStackMapSink {})
.unwrap();
unwind_context.add_function(func_id, &ctx, module.isa());
}
3 changes: 2 additions & 1 deletion src/base.rs
@@ -1,5 +1,6 @@
//! Codegen of a single function

use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
use rustc_index::vec::IndexVec;
use rustc_middle::ty::adjustment::PointerCast;
use rustc_middle::ty::layout::FnAbiExt;
Expand Down Expand Up @@ -131,7 +132,7 @@ pub(crate) fn codegen_fn<'tcx>(
let module = &mut cx.module;
tcx.sess.time("define function", || {
module
.define_function(func_id, context, &mut cranelift_codegen::binemit::NullTrapSink {})
.define_function(func_id, context, &mut NullTrapSink {}, &mut NullStackMapSink {})
.unwrap()
});

Expand Down
4 changes: 3 additions & 1 deletion src/driver/jit.rs
Expand Up @@ -5,6 +5,7 @@ use std::cell::RefCell;
use std::ffi::CString;
use std::os::raw::{c_char, c_int};

use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
use rustc_codegen_ssa::CrateInfo;
use rustc_middle::mir::mono::MonoItem;
use rustc_session::config::EntryFnType;
Expand Down Expand Up @@ -297,7 +298,8 @@ fn codegen_shim<'tcx>(cx: &mut CodegenCx<'_, 'tcx>, inst: Instance<'tcx>) {
.define_function(
func_id,
&mut Context::for_function(trampoline),
&mut cranelift_codegen::binemit::NullTrapSink {},
&mut NullTrapSink {},
&mut NullStackMapSink {},
)
.unwrap();
}
9 changes: 3 additions & 6 deletions src/main_shim.rs
@@ -1,3 +1,4 @@
use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
use rustc_hir::LangItem;
use rustc_session::config::EntryFnType;

Expand Down Expand Up @@ -100,12 +101,8 @@ pub(crate) fn maybe_create_entry_wrapper(
bcx.seal_all_blocks();
bcx.finalize();
}
m.define_function(
cmain_func_id,
&mut ctx,
&mut cranelift_codegen::binemit::NullTrapSink {},
)
.unwrap();
m.define_function(cmain_func_id, &mut ctx, &mut NullTrapSink {}, &mut NullStackMapSink {})
.unwrap();
unwind_context.add_function(cmain_func_id, &ctx, m.isa());
}
}

0 comments on commit 56fe51c

Please sign in to comment.