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>(
226226 . expect ( "value location ranges" )
227227 } ) ;
228228
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+ ) ) ;
237244
238245 let mut clif = String :: new ( ) ;
239246 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=
1818
1919# Cleanup
2020rm -r target/out || true
21- mkdir -p target/out/clif
2221
2322# Perform all tests
2423echo " [BUILD] mini_core"
You can’t perform that action at this time.
0 commit comments