@@ -76,7 +76,6 @@ use std::path::{Path, PathBuf};
7676use std:: sync:: atomic:: { AtomicBool , Ordering } ;
7777use std:: sync:: { Arc , Mutex } ;
7878
79- use back:: lto:: { ThinBuffer , ThinData } ;
8079use gccjit:: { CType , Context , OptimizationLevel } ;
8180#[ cfg( feature = "master" ) ]
8281use gccjit:: { TargetInfo , Version } ;
@@ -87,7 +86,9 @@ use rustc_codegen_ssa::back::write::{
8786} ;
8887use rustc_codegen_ssa:: base:: codegen_crate;
8988use rustc_codegen_ssa:: target_features:: cfg_target_feature;
90- use rustc_codegen_ssa:: traits:: { CodegenBackend , ExtraBackendMethods , WriteBackendMethods } ;
89+ use rustc_codegen_ssa:: traits:: {
90+ CodegenBackend , ExtraBackendMethods , ThinBufferMethods , WriteBackendMethods ,
91+ } ;
9192use rustc_codegen_ssa:: { CodegenResults , CompiledModule , ModuleCodegen , TargetConfig } ;
9293use rustc_data_structures:: fx:: FxIndexMap ;
9394use rustc_data_structures:: sync:: IntoDynSyncSend ;
@@ -176,8 +177,6 @@ pub struct GccCodegenBackend {
176177 lto_supported : Arc < AtomicBool > ,
177178}
178179
179- static LTO_SUPPORTED : AtomicBool = AtomicBool :: new ( false ) ;
180-
181180fn load_libgccjit_if_needed ( libgccjit_target_lib_file : & Path ) {
182181 if gccjit:: is_loaded ( ) {
183182 // Do not load a libgccjit second time.
@@ -248,7 +247,6 @@ impl CodegenBackend for GccCodegenBackend {
248247 #[ cfg( feature = "master" ) ]
249248 {
250249 let lto_supported = gccjit:: is_lto_supported ( ) ;
251- LTO_SUPPORTED . store ( lto_supported, Ordering :: SeqCst ) ;
252250 self . lto_supported . store ( lto_supported, Ordering :: SeqCst ) ;
253251
254252 gccjit:: set_global_personality_function_name ( b"rust_eh_personality\0 " ) ;
@@ -278,6 +276,10 @@ impl CodegenBackend for GccCodegenBackend {
278276 }
279277 }
280278
279+ fn thin_lto_supported ( & self ) -> bool {
280+ false
281+ }
282+
281283 fn provide ( & self , providers : & mut Providers ) {
282284 providers. queries . global_backend_features =
283285 |tcx, ( ) | gcc_util:: global_gcc_features ( tcx. sess )
@@ -418,11 +420,19 @@ unsafe impl Send for SyncContext {}
418420// FIXME(antoyo): that shouldn't be Sync. Parallel compilation is currently disabled with "CodegenBackend::supports_parallel()".
419421unsafe impl Sync for SyncContext { }
420422
423+ pub struct ThinBuffer ;
424+
425+ impl ThinBufferMethods for ThinBuffer {
426+ fn data ( & self ) -> & [ u8 ] {
427+ & [ ]
428+ }
429+ }
430+
421431impl WriteBackendMethods for GccCodegenBackend {
422432 type Module = GccContext ;
423433 type TargetMachine = ( ) ;
424434 type ModuleBuffer = ModuleBuffer ;
425- type ThinData = ThinData ;
435+ type ThinData = ( ) ;
426436 type ThinBuffer = ThinBuffer ;
427437
428438 fn run_and_optimize_fat_lto (
@@ -438,15 +448,15 @@ impl WriteBackendMethods for GccCodegenBackend {
438448 }
439449
440450 fn run_thin_lto (
441- cgcx : & CodegenContext ,
442- dcx : DiagCtxtHandle < ' _ > ,
451+ _cgcx : & CodegenContext ,
452+ _dcx : DiagCtxtHandle < ' _ > ,
443453 // FIXME(bjorn3): Limit LTO exports to these symbols
444454 _exported_symbols_for_lto : & [ String ] ,
445- each_linked_rlib_for_lto : & [ PathBuf ] ,
446- modules : Vec < ( String , Self :: ThinBuffer ) > ,
447- cached_modules : Vec < ( SerializedModule < Self :: ModuleBuffer > , WorkProduct ) > ,
455+ _each_linked_rlib_for_lto : & [ PathBuf ] ,
456+ _modules : Vec < ( String , Self :: ThinBuffer ) > ,
457+ _cached_modules : Vec < ( SerializedModule < Self :: ModuleBuffer > , WorkProduct ) > ,
448458 ) -> ( Vec < ThinModule < Self > > , Vec < WorkProduct > ) {
449- back :: lto :: run_thin ( cgcx , dcx , each_linked_rlib_for_lto , modules , cached_modules )
459+ unreachable ! ( )
450460 }
451461
452462 fn print_pass_timings ( & self ) {
@@ -467,12 +477,12 @@ impl WriteBackendMethods for GccCodegenBackend {
467477 }
468478
469479 fn optimize_thin (
470- cgcx : & CodegenContext ,
480+ _cgcx : & CodegenContext ,
471481 _shared_emitter : & SharedEmitter ,
472482 _tm_factory : TargetMachineFactoryFn < Self > ,
473- thin : ThinModule < Self > ,
483+ _thin : ThinModule < Self > ,
474484 ) -> ModuleCodegen < Self :: Module > {
475- back :: lto :: optimize_thin_module ( thin , cgcx )
485+ unreachable ! ( )
476486 }
477487
478488 fn codegen (
@@ -484,8 +494,8 @@ impl WriteBackendMethods for GccCodegenBackend {
484494 back:: write:: codegen ( cgcx, shared_emitter, module, config)
485495 }
486496
487- fn prepare_thin ( module : ModuleCodegen < Self :: Module > ) -> ( String , Self :: ThinBuffer ) {
488- back :: lto :: prepare_thin ( module )
497+ fn prepare_thin ( _module : ModuleCodegen < Self :: Module > ) -> ( String , Self :: ThinBuffer ) {
498+ unreachable ! ( )
489499 }
490500
491501 fn serialize_module ( _module : ModuleCodegen < Self :: Module > ) -> ( String , Self :: ModuleBuffer ) {
0 commit comments