@@ -30,6 +30,7 @@ pub(super) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! {
3030 let mut jit_builder =
3131 JITBuilder :: with_isa ( crate :: build_isa ( tcx. sess ) , cranelift_module:: default_libcall_names ( ) ) ;
3232 jit_builder. hotswap ( matches ! ( backend_config. codegen_mode, CodegenMode :: JitLazy ) ) ;
33+ crate :: compiler_builtins:: register_functions_for_jit ( & mut jit_builder) ;
3334 jit_builder. symbols ( imported_symbols) ;
3435 let mut jit_module = JITModule :: new ( jit_builder) ;
3536 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) -> ! {
4748
4849 super :: time ( tcx, "codegen mono items" , || {
4950 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 {
5252 match mono_item {
5353 MonoItem :: Fn ( inst) => match backend_config. codegen_mode {
5454 CodegenMode :: Aot => unreachable ! ( ) ,
5555 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) ) ;
5957 }
6058 CodegenMode :: JitLazy => codegen_shim ( & mut cx, inst) ,
6159 } ,
@@ -175,8 +173,7 @@ extern "C" fn __clif_jit_fn(instance_ptr: *const Instance<'static>) -> *const u8
175173 jit_module. prepare_for_function_redefine ( func_id) . unwrap ( ) ;
176174
177175 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) ) ;
180177
181178 let ( global_asm, _debug_context, unwind_context) = cx. finalize ( ) ;
182179 assert ! ( global_asm. is_empty( ) ) ;
0 commit comments