@@ -322,8 +322,8 @@ fn produce_final_output_artifacts(
322322 // These are used in linking steps and will be cleaned up afterward.
323323}
324324
325- fn make_module ( sess : & Session , name : String ) -> UnwindModule < ObjectModule > {
326- let isa = crate :: build_isa ( sess, false ) ;
325+ fn make_module ( tcx : TyCtxt < ' _ > , name : String ) -> UnwindModule < ObjectModule > {
326+ let isa = crate :: build_isa ( tcx . sess , false ) ;
327327
328328 let mut builder =
329329 ObjectBuilder :: new ( isa, name + ".o" , cranelift_module:: default_libcall_names ( ) ) . unwrap ( ) ;
@@ -333,12 +333,13 @@ fn make_module(sess: &Session, name: String) -> UnwindModule<ObjectModule> {
333333 // explicitly disable it on MinGW as rustc already disables it by default on MinGW and as such
334334 // isn't tested. If rustc enables it in the future on MinGW, we can re-enable it too once it has
335335 // been on MinGW.
336- let default_function_sections = sess. target . function_sections && !sess. target . is_like_windows ;
336+ let default_function_sections =
337+ tcx. sess . target . function_sections && !tcx. sess . target . is_like_windows ;
337338 builder. per_function_section (
338- sess. opts . unstable_opts . function_sections . unwrap_or ( default_function_sections) ,
339+ tcx . sess . opts . unstable_opts . function_sections . unwrap_or ( default_function_sections) ,
339340 ) ;
340341
341- UnwindModule :: new ( ObjectModule :: new ( builder) , true )
342+ UnwindModule :: new ( ObjectModule :: new ( builder) , tcx , true )
342343}
343344
344345fn emit_cgu (
@@ -579,7 +580,7 @@ fn module_codegen(
579580 ConcurrencyLimiterToken ,
580581 ) ,
581582) -> OngoingModuleCodegen {
582- let mut module = make_module ( tcx. sess , cgu_name. as_str ( ) . to_string ( ) ) ;
583+ let mut module = make_module ( tcx, cgu_name. as_str ( ) . to_string ( ) ) ;
583584
584585 let ( mut debug_context, codegened_functions, mut global_asm) =
585586 codegen_cgu_content ( tcx, & mut module, cgu_name) ;
@@ -643,7 +644,7 @@ fn module_codegen(
643644}
644645
645646fn emit_allocator_module ( tcx : TyCtxt < ' _ > ) -> Option < CompiledModule > {
646- let mut allocator_module = make_module ( tcx. sess , "allocator_shim" . to_string ( ) ) ;
647+ let mut allocator_module = make_module ( tcx, "allocator_shim" . to_string ( ) ) ;
647648 let created_alloc_shim = crate :: allocator:: codegen ( tcx, & mut allocator_module) ;
648649
649650 if created_alloc_shim {
0 commit comments