@@ -30,6 +30,7 @@ pub(super) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! {
30
30
let mut jit_builder =
31
31
JITBuilder :: with_isa ( crate :: build_isa ( tcx. sess ) , cranelift_module:: default_libcall_names ( ) ) ;
32
32
jit_builder. hotswap ( matches ! ( backend_config. codegen_mode, CodegenMode :: JitLazy ) ) ;
33
+ crate :: compiler_builtins:: register_functions_for_jit ( & mut jit_builder) ;
33
34
jit_builder. symbols ( imported_symbols) ;
34
35
let mut jit_module = JITModule :: new ( jit_builder) ;
35
36
assert_eq ! ( pointer_ty( tcx) , jit_module. target_config( ) . pointer_type( ) ) ;
@@ -47,15 +48,12 @@ pub(super) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! {
47
48
48
49
super :: time ( tcx, "codegen mono items" , || {
49
50
super :: predefine_mono_items ( & mut cx, & mono_items) ;
50
- for ( mono_item, ( linkage, visibility) ) in mono_items {
51
- let linkage = crate :: linkage:: get_clif_linkage ( mono_item, linkage, visibility) ;
51
+ for ( mono_item, _) in mono_items {
52
52
match mono_item {
53
53
MonoItem :: Fn ( inst) => match backend_config. codegen_mode {
54
54
CodegenMode :: Aot => unreachable ! ( ) ,
55
55
CodegenMode :: Jit => {
56
- cx. tcx
57
- . sess
58
- . time ( "codegen fn" , || crate :: base:: codegen_fn ( & mut cx, inst, linkage) ) ;
56
+ cx. tcx . sess . time ( "codegen fn" , || crate :: base:: codegen_fn ( & mut cx, inst) ) ;
59
57
}
60
58
CodegenMode :: JitLazy => codegen_shim ( & mut cx, inst) ,
61
59
} ,
@@ -175,8 +173,7 @@ extern "C" fn __clif_jit_fn(instance_ptr: *const Instance<'static>) -> *const u8
175
173
jit_module. prepare_for_function_redefine ( func_id) . unwrap ( ) ;
176
174
177
175
let mut cx = crate :: CodegenCx :: new ( tcx, backend_config, jit_module, false ) ;
178
- tcx. sess
179
- . time ( "codegen fn" , || crate :: base:: codegen_fn ( & mut cx, instance, Linkage :: Export ) ) ;
176
+ tcx. sess . time ( "codegen fn" , || crate :: base:: codegen_fn ( & mut cx, instance) ) ;
180
177
181
178
let ( global_asm, _debug_context, unwind_context) = cx. finalize ( ) ;
182
179
assert ! ( global_asm. is_empty( ) ) ;
0 commit comments