Skip to content

Commit 56fe51c

Browse files
committed
Update Cranelift
1 parent 7bd3950 commit 56fe51c

File tree

5 files changed

+31
-30
lines changed

5 files changed

+31
-30
lines changed

Cargo.lock

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/allocator.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
use crate::prelude::*;
55

6+
use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
67
use rustc_ast::expand::allocator::{AllocatorKind, AllocatorTy, ALLOCATOR_METHODS};
78
use rustc_span::symbol::sym;
89

@@ -92,7 +93,7 @@ fn codegen_inner(
9293
bcx.finalize();
9394
}
9495
module
95-
.define_function(func_id, &mut ctx, &mut cranelift_codegen::binemit::NullTrapSink {})
96+
.define_function(func_id, &mut ctx, &mut NullTrapSink {}, &mut NullStackMapSink {})
9697
.unwrap();
9798
unwind_context.add_function(func_id, &ctx, module.isa());
9899
}
@@ -132,7 +133,7 @@ fn codegen_inner(
132133
bcx.finalize();
133134
}
134135
module
135-
.define_function(func_id, &mut ctx, &mut cranelift_codegen::binemit::NullTrapSink {})
136+
.define_function(func_id, &mut ctx, &mut NullTrapSink {}, &mut NullStackMapSink {})
136137
.unwrap();
137138
unwind_context.add_function(func_id, &ctx, module.isa());
138139
}

src/base.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Codegen of a single function
22
3+
use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
34
use rustc_index::vec::IndexVec;
45
use rustc_middle::ty::adjustment::PointerCast;
56
use rustc_middle::ty::layout::FnAbiExt;
@@ -131,7 +132,7 @@ pub(crate) fn codegen_fn<'tcx>(
131132
let module = &mut cx.module;
132133
tcx.sess.time("define function", || {
133134
module
134-
.define_function(func_id, context, &mut cranelift_codegen::binemit::NullTrapSink {})
135+
.define_function(func_id, context, &mut NullTrapSink {}, &mut NullStackMapSink {})
135136
.unwrap()
136137
});
137138

src/driver/jit.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use std::cell::RefCell;
55
use std::ffi::CString;
66
use std::os::raw::{c_char, c_int};
77

8+
use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
89
use rustc_codegen_ssa::CrateInfo;
910
use rustc_middle::mir::mono::MonoItem;
1011
use rustc_session::config::EntryFnType;
@@ -297,7 +298,8 @@ fn codegen_shim<'tcx>(cx: &mut CodegenCx<'_, 'tcx>, inst: Instance<'tcx>) {
297298
.define_function(
298299
func_id,
299300
&mut Context::for_function(trampoline),
300-
&mut cranelift_codegen::binemit::NullTrapSink {},
301+
&mut NullTrapSink {},
302+
&mut NullStackMapSink {},
301303
)
302304
.unwrap();
303305
}

src/main_shim.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
12
use rustc_hir::LangItem;
23
use rustc_session::config::EntryFnType;
34

@@ -100,12 +101,8 @@ pub(crate) fn maybe_create_entry_wrapper(
100101
bcx.seal_all_blocks();
101102
bcx.finalize();
102103
}
103-
m.define_function(
104-
cmain_func_id,
105-
&mut ctx,
106-
&mut cranelift_codegen::binemit::NullTrapSink {},
107-
)
108-
.unwrap();
104+
m.define_function(cmain_func_id, &mut ctx, &mut NullTrapSink {}, &mut NullStackMapSink {})
105+
.unwrap();
109106
unwind_context.add_function(cmain_func_id, &ctx, m.isa());
110107
}
111108
}

0 commit comments

Comments
 (0)