@@ -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.
@@ -485,9 +485,9 @@ fn thin_lto(
485485 });*/
486486
487487 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);
491491 //let exists = my_path.exists();
492492 //println!("Path: {:?}: {}", path, exists);
493493 /*module.module_llvm.should_combine_object_files = true;
@@ -644,7 +644,7 @@ pub unsafe fn optimize_thin_module(
644644 unimplemented ! ( "from uncompressed file" )
645645 }
646646 }
647- Arc :: new ( context)
647+ Arc :: new ( SyncContext :: new ( context) )
648648 }
649649 } ;
650650 let module = ModuleCodegen {
@@ -718,15 +718,15 @@ pub unsafe fn optimize_thin_module(
718718}
719719
720720pub struct ThinBuffer {
721- context : Arc < Context < ' static > > ,
721+ context : Arc < SyncContext > ,
722722}
723723
724724// TODO: check if this makes sense to make ThinBuffer Send and Sync.
725725unsafe impl Send for ThinBuffer { }
726726unsafe impl Sync for ThinBuffer { }
727727
728728impl ThinBuffer {
729- pub fn new ( context : & Arc < Context < ' static > > ) -> Self {
729+ pub ( crate ) fn new ( context : & Arc < SyncContext > ) -> Self {
730730 Self { context : Arc :: clone ( context) }
731731 }
732732}
0 commit comments