File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 22//! standalone executable.
33
44use std:: fs:: { self , File } ;
5+ use std:: io:: BufWriter ;
56use std:: path:: { Path , PathBuf } ;
67use std:: sync:: Arc ;
78use std:: thread:: JoinHandle ;
@@ -397,14 +398,19 @@ fn emit_module(
397398 }
398399
399400 let tmp_file = output_filenames. temp_path ( OutputType :: Object , Some ( & name) ) ;
400- let mut file = match File :: create ( & tmp_file) {
401+ let file = match File :: create ( & tmp_file) {
401402 Ok ( file) => file,
402403 Err ( err) => return Err ( format ! ( "error creating object file: {}" , err) ) ,
403404 } ;
404405
406+ let mut file = BufWriter :: new ( file) ;
405407 if let Err ( err) = object. write_stream ( & mut file) {
406408 return Err ( format ! ( "error writing object file: {}" , err) ) ;
407409 }
410+ let file = match file. into_inner ( ) {
411+ Ok ( file) => file,
412+ Err ( err) => return Err ( format ! ( "error writing object file: {}" , err) ) ,
413+ } ;
408414
409415 prof. artifact_size ( "object_file" , & * name, file. metadata ( ) . unwrap ( ) . len ( ) ) ;
410416
Original file line number Diff line number Diff line change @@ -241,6 +241,8 @@ impl CodegenBackend for CraneliftCodegenBackend {
241241 sess : & Session ,
242242 outputs : & OutputFilenames ,
243243 ) -> ( CodegenResults , FxIndexMap < WorkProductId , WorkProduct > ) {
244+ let _timer = sess. timer ( "finish_ongoing_codegen" ) ;
245+
244246 ongoing_codegen. downcast :: < driver:: aot:: OngoingCodegen > ( ) . unwrap ( ) . join (
245247 sess,
246248 outputs,
You can’t perform that action at this time.
0 commit comments