@@ -39,7 +39,7 @@ use tempfile::{tempdir, TempDir};
3939
4040use crate :: back:: write:: save_temp_bitcode;
4141use 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 } ;
4343
4444/// We keep track of the computed LTO cache keys from the previous
4545/// session to determine which CGUs we can reuse.
@@ -483,9 +483,9 @@ fn thin_lto(
483483 });*/
484484
485485 match module {
486- SerializedModule :: Local ( ref module_buffer ) => {
487- let path = module_buffer. 0 . to_str ( ) . expect ( "path" ) ;
488- let my_path = PathBuf :: from ( path) ;
486+ SerializedModule :: Local ( _ ) => {
487+ // let path = module_buffer.0.to_str().expect("path");
488+ // let my_path = PathBuf::from(path);
489489 //let exists = my_path.exists();
490490 //println!("Path: {:?}: {}", path, exists);
491491 /*module.module_llvm.should_combine_object_files = true;
@@ -642,7 +642,7 @@ pub unsafe fn optimize_thin_module(
642642 unimplemented ! ( "from uncompressed file" )
643643 }
644644 }
645- Arc :: new ( context)
645+ Arc :: new ( SyncContext :: new ( context) )
646646 }
647647 } ;
648648 let module = ModuleCodegen {
@@ -716,15 +716,15 @@ pub unsafe fn optimize_thin_module(
716716}
717717
718718pub struct ThinBuffer {
719- context : Arc < Context < ' static > > ,
719+ context : Arc < SyncContext > ,
720720}
721721
722722// TODO: check if this makes sense to make ThinBuffer Send and Sync.
723723unsafe impl Send for ThinBuffer { }
724724unsafe impl Sync for ThinBuffer { }
725725
726726impl ThinBuffer {
727- pub fn new ( context : & Arc < Context < ' static > > ) -> Self {
727+ pub ( crate ) fn new ( context : & Arc < SyncContext > ) -> Self {
728728 Self { context : Arc :: clone ( context) }
729729 }
730730}
0 commit comments