@@ -117,17 +117,13 @@ pub(crate) fn create_target_machine(tcx: TyCtxt<'_>, mod_name: &str) -> OwnedTar
117117 tcx. sess . split_debuginfo ( ) ,
118118 tcx. sess . opts . unstable_opts . split_dwarf_kind ,
119119 mod_name,
120- tcx. sess . invocation_temp . as_deref ( ) ,
121120 )
122121 } else {
123122 None
124123 } ;
125124
126- let output_obj_file = Some ( tcx. output_filenames ( ( ) ) . temp_path_for_cgu (
127- OutputType :: Object ,
128- mod_name,
129- tcx. sess . invocation_temp . as_deref ( ) ,
130- ) ) ;
125+ let output_obj_file =
126+ Some ( tcx. output_filenames ( ( ) ) . temp_path_for_cgu ( OutputType :: Object , mod_name) ) ;
131127 let config = TargetMachineFactoryConfig { split_dwarf_file, output_obj_file } ;
132128
133129 target_machine_factory (
@@ -322,11 +318,7 @@ pub(crate) fn save_temp_bitcode(
322318 return ;
323319 }
324320 let ext = format ! ( "{name}.bc" ) ;
325- let path = cgcx. output_filenames . temp_path_ext_for_cgu (
326- & ext,
327- & module. name ,
328- cgcx. invocation_temp . as_deref ( ) ,
329- ) ;
321+ let path = cgcx. output_filenames . temp_path_ext_for_cgu ( & ext, & module. name ) ;
330322 write_bitcode_to_file ( & module. module_llvm , & path)
331323}
332324
@@ -949,11 +941,8 @@ pub(crate) fn optimize(
949941 if let Some ( thin_lto_buffer) = thin_lto_buffer {
950942 let thin_lto_buffer = thin_lto_buffer. unwrap ( ) ;
951943 module. thin_lto_buffer = Some ( thin_lto_buffer. data ( ) . to_vec ( ) ) ;
952- let bc_summary_out = cgcx. output_filenames . temp_path_for_cgu (
953- OutputType :: ThinLinkBitcode ,
954- & module. name ,
955- cgcx. invocation_temp . as_deref ( ) ,
956- ) ;
944+ let bc_summary_out =
945+ cgcx. output_filenames . temp_path_for_cgu ( OutputType :: ThinLinkBitcode , & module. name ) ;
957946 if let Some ( thin_lto_summary_buffer) = thin_lto_summary_buffer
958947 && let Some ( thin_link_bitcode_filename) = bc_summary_out. file_name ( )
959948 {
@@ -1008,16 +997,8 @@ pub(crate) fn codegen(
1008997 // copy it to the .o file, and delete the bitcode if it wasn't
1009998 // otherwise requested.
1010999
1011- let bc_out = cgcx. output_filenames . temp_path_for_cgu (
1012- OutputType :: Bitcode ,
1013- & module. name ,
1014- cgcx. invocation_temp . as_deref ( ) ,
1015- ) ;
1016- let obj_out = cgcx. output_filenames . temp_path_for_cgu (
1017- OutputType :: Object ,
1018- & module. name ,
1019- cgcx. invocation_temp . as_deref ( ) ,
1020- ) ;
1000+ let bc_out = cgcx. output_filenames . temp_path_for_cgu ( OutputType :: Bitcode , & module. name ) ;
1001+ let obj_out = cgcx. output_filenames . temp_path_for_cgu ( OutputType :: Object , & module. name ) ;
10211002
10221003 if config. bitcode_needed ( ) {
10231004 if config. emit_bc || config. emit_obj == EmitObj :: Bitcode {
@@ -1055,11 +1036,8 @@ pub(crate) fn codegen(
10551036 if config. emit_ir {
10561037 let _timer =
10571038 prof. generic_activity_with_arg ( "LLVM_module_codegen_emit_ir" , & * module. name ) ;
1058- let out = cgcx. output_filenames . temp_path_for_cgu (
1059- OutputType :: LlvmAssembly ,
1060- & module. name ,
1061- cgcx. invocation_temp . as_deref ( ) ,
1062- ) ;
1039+ let out =
1040+ cgcx. output_filenames . temp_path_for_cgu ( OutputType :: LlvmAssembly , & module. name ) ;
10631041 let out_c = path_to_c_string ( & out) ;
10641042
10651043 extern "C" fn demangle_callback (
@@ -1103,11 +1081,7 @@ pub(crate) fn codegen(
11031081 if config. emit_asm {
11041082 let _timer =
11051083 prof. generic_activity_with_arg ( "LLVM_module_codegen_emit_asm" , & * module. name ) ;
1106- let path = cgcx. output_filenames . temp_path_for_cgu (
1107- OutputType :: Assembly ,
1108- & module. name ,
1109- cgcx. invocation_temp . as_deref ( ) ,
1110- ) ;
1084+ let path = cgcx. output_filenames . temp_path_for_cgu ( OutputType :: Assembly , & module. name ) ;
11111085
11121086 // We can't use the same module for asm and object code output,
11131087 // because that triggers various errors like invalid IR or broken
@@ -1136,9 +1110,7 @@ pub(crate) fn codegen(
11361110 let _timer =
11371111 prof. generic_activity_with_arg ( "LLVM_module_codegen_emit_obj" , & * module. name ) ;
11381112
1139- let dwo_out = cgcx
1140- . output_filenames
1141- . temp_path_dwo_for_cgu ( & module. name , cgcx. invocation_temp . as_deref ( ) ) ;
1113+ let dwo_out = cgcx. output_filenames . temp_path_dwo_for_cgu ( & module. name ) ;
11421114 let dwo_out = match ( cgcx. split_debuginfo , cgcx. split_dwarf_kind ) {
11431115 // Don't change how DWARF is emitted when disabled.
11441116 ( SplitDebuginfo :: Off , _) => None ,
@@ -1203,7 +1175,6 @@ pub(crate) fn codegen(
12031175 config. emit_asm ,
12041176 config. emit_ir ,
12051177 & cgcx. output_filenames ,
1206- cgcx. invocation_temp . as_deref ( ) ,
12071178 )
12081179}
12091180
0 commit comments