@@ -31,8 +31,16 @@ pub(crate) unsafe fn codegen(
31
31
// TODO(antoyo): remove this environment variable.
32
32
let fat_lto = env:: var ( "EMBED_LTO_BITCODE" ) . as_deref ( ) == Ok ( "1" ) ;
33
33
34
- let bc_out = cgcx. output_filenames . temp_path_for_cgu ( OutputType :: Bitcode , & module. name ) ;
35
- let obj_out = cgcx. output_filenames . temp_path_for_cgu ( OutputType :: Object , & module. name ) ;
34
+ let bc_out = cgcx. output_filenames . temp_path_for_cgu (
35
+ OutputType :: Bitcode ,
36
+ & module. name ,
37
+ cgcx. invocation_temp . as_deref ( ) ,
38
+ ) ;
39
+ let obj_out = cgcx. output_filenames . temp_path_for_cgu (
40
+ OutputType :: Object ,
41
+ & module. name ,
42
+ cgcx. invocation_temp . as_deref ( ) ,
43
+ ) ;
36
44
37
45
if config. bitcode_needed ( ) {
38
46
if fat_lto {
@@ -113,15 +121,22 @@ pub(crate) unsafe fn codegen(
113
121
}
114
122
115
123
if config. emit_ir {
116
- let out =
117
- cgcx. output_filenames . temp_path_for_cgu ( OutputType :: LlvmAssembly , & module. name ) ;
124
+ let out = cgcx. output_filenames . temp_path_for_cgu (
125
+ OutputType :: LlvmAssembly ,
126
+ & module. name ,
127
+ cgcx. invocation_temp . as_deref ( ) ,
128
+ ) ;
118
129
std:: fs:: write ( out, "" ) . expect ( "write file" ) ;
119
130
}
120
131
121
132
if config. emit_asm {
122
133
let _timer =
123
134
cgcx. prof . generic_activity_with_arg ( "GCC_module_codegen_emit_asm" , & * module. name ) ;
124
- let path = cgcx. output_filenames . temp_path_for_cgu ( OutputType :: Assembly , & module. name ) ;
135
+ let path = cgcx. output_filenames . temp_path_for_cgu (
136
+ OutputType :: Assembly ,
137
+ & module. name ,
138
+ cgcx. invocation_temp . as_deref ( ) ,
139
+ ) ;
125
140
context. compile_to_file ( OutputKind :: Assembler , path. to_str ( ) . expect ( "path to str" ) ) ;
126
141
}
127
142
@@ -235,6 +250,7 @@ pub(crate) unsafe fn codegen(
235
250
config. emit_asm ,
236
251
config. emit_ir ,
237
252
& cgcx. output_filenames ,
253
+ cgcx. invocation_temp . as_deref ( ) ,
238
254
) )
239
255
}
240
256
0 commit comments