File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 2
2
//! standalone executable.
3
3
4
4
use std:: fs:: { self , File } ;
5
+ use std:: io:: BufWriter ;
5
6
use std:: path:: { Path , PathBuf } ;
6
7
use std:: sync:: Arc ;
7
8
use std:: thread:: JoinHandle ;
@@ -397,14 +398,19 @@ fn emit_module(
397
398
}
398
399
399
400
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) {
401
402
Ok ( file) => file,
402
403
Err ( err) => return Err ( format ! ( "error creating object file: {}" , err) ) ,
403
404
} ;
404
405
406
+ let mut file = BufWriter :: new ( file) ;
405
407
if let Err ( err) = object. write_stream ( & mut file) {
406
408
return Err ( format ! ( "error writing object file: {}" , err) ) ;
407
409
}
410
+ let file = match file. into_inner ( ) {
411
+ Ok ( file) => file,
412
+ Err ( err) => return Err ( format ! ( "error writing object file: {}" , err) ) ,
413
+ } ;
408
414
409
415
prof. artifact_size ( "object_file" , & * name, file. metadata ( ) . unwrap ( ) . len ( ) ) ;
410
416
Original file line number Diff line number Diff line change @@ -241,6 +241,8 @@ impl CodegenBackend for CraneliftCodegenBackend {
241
241
sess : & Session ,
242
242
outputs : & OutputFilenames ,
243
243
) -> ( CodegenResults , FxIndexMap < WorkProductId , WorkProduct > ) {
244
+ let _timer = sess. timer ( "finish_ongoing_codegen" ) ;
245
+
244
246
ongoing_codegen. downcast :: < driver:: aot:: OngoingCodegen > ( ) . unwrap ( ) . join (
245
247
sess,
246
248
outputs,
You can’t perform that action at this time.
0 commit comments