@@ -39,7 +39,7 @@ use tempfile::{tempdir, TempDir};
39
39
40
40
use crate :: back:: write:: save_temp_bitcode;
41
41
use crate :: errors:: { DynamicLinkingWithLTO , LtoBitcodeFromRlib , LtoDisallowed , LtoDylib } ;
42
- use crate :: { to_gcc_opt_level, GccCodegenBackend , GccContext } ;
42
+ use crate :: { to_gcc_opt_level, GccCodegenBackend , GccContext , SyncContext } ;
43
43
44
44
/// We keep track of the computed LTO cache keys from the previous
45
45
/// session to determine which CGUs we can reuse.
@@ -485,9 +485,9 @@ fn thin_lto(
485
485
});*/
486
486
487
487
match module {
488
- SerializedModule :: Local ( ref module_buffer ) => {
489
- let path = module_buffer. 0 . to_str ( ) . expect ( "path" ) ;
490
- let my_path = PathBuf :: from ( path) ;
488
+ SerializedModule :: Local ( _ ) => {
489
+ // let path = module_buffer.0.to_str().expect("path");
490
+ // let my_path = PathBuf::from(path);
491
491
//let exists = my_path.exists();
492
492
//println!("Path: {:?}: {}", path, exists);
493
493
/*module.module_llvm.should_combine_object_files = true;
@@ -644,7 +644,7 @@ pub unsafe fn optimize_thin_module(
644
644
unimplemented ! ( "from uncompressed file" )
645
645
}
646
646
}
647
- Arc :: new ( context)
647
+ Arc :: new ( SyncContext :: new ( context) )
648
648
}
649
649
} ;
650
650
let module = ModuleCodegen {
@@ -718,15 +718,15 @@ pub unsafe fn optimize_thin_module(
718
718
}
719
719
720
720
pub struct ThinBuffer {
721
- context : Arc < Context < ' static > > ,
721
+ context : Arc < SyncContext > ,
722
722
}
723
723
724
724
// TODO: check if this makes sense to make ThinBuffer Send and Sync.
725
725
unsafe impl Send for ThinBuffer { }
726
726
unsafe impl Sync for ThinBuffer { }
727
727
728
728
impl ThinBuffer {
729
- pub fn new ( context : & Arc < Context < ' static > > ) -> Self {
729
+ pub ( crate ) fn new ( context : & Arc < SyncContext > ) -> Self {
730
730
Self { context : Arc :: clone ( context) }
731
731
}
732
732
}
0 commit comments