File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -226,14 +226,21 @@ pub(crate) fn write_clif_file<'tcx>(
226
226
. expect ( "value location ranges" )
227
227
} ) ;
228
228
229
- let symbol_name = tcx. symbol_name ( instance) . name ;
230
- let clif_file_name = format ! (
231
- "{}/{}__{}.{}.clif" ,
232
- concat!( env!( "CARGO_MANIFEST_DIR" ) , "/target/out/clif" ) ,
233
- tcx. crate_name( LOCAL_CRATE ) ,
234
- symbol_name,
235
- postfix,
236
- ) ;
229
+ let clif_output_dir = tcx
230
+ . output_filenames ( LOCAL_CRATE )
231
+ . with_extension ( "clif" ) ;
232
+
233
+ match std:: fs:: create_dir ( & clif_output_dir) {
234
+ Ok ( ( ) ) => { }
235
+ Err ( err) if err. kind ( ) == std:: io:: ErrorKind :: AlreadyExists => { }
236
+ res @ Err ( _) => res. unwrap ( ) ,
237
+ }
238
+
239
+ let clif_file_name = clif_output_dir. join ( format ! (
240
+ "{}.{}.clif" ,
241
+ tcx. symbol_name( instance) . name,
242
+ postfix
243
+ ) ) ;
237
244
238
245
let mut clif = String :: new ( ) ;
239
246
cranelift_codegen:: write:: decorate_function (
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ RUSTC=$RUSTC" "$RUSTFLAGS" -L crate=target/out --out-dir target/out -Cdebuginfo=
18
18
19
19
# Cleanup
20
20
rm -r target/out || true
21
- mkdir -p target/out/clif
22
21
23
22
# Perform all tests
24
23
echo " [BUILD] mini_core"
You can’t perform that action at this time.
0 commit comments