@@ -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:: profiling:: SelfProfilerRef ;
@@ -177,8 +178,6 @@ pub struct GccCodegenBackend {
177178 lto_supported : Arc < AtomicBool > ,
178179}
179180
180- static LTO_SUPPORTED : AtomicBool = AtomicBool :: new ( false ) ;
181-
182181fn load_libgccjit_if_needed ( libgccjit_target_lib_file : & Path ) {
183182 if gccjit:: is_loaded ( ) {
184183 // Do not load a libgccjit second time.
@@ -249,7 +248,6 @@ impl CodegenBackend for GccCodegenBackend {
249248 #[ cfg( feature = "master" ) ]
250249 {
251250 let lto_supported = gccjit:: is_lto_supported ( ) ;
252- LTO_SUPPORTED . store ( lto_supported, Ordering :: SeqCst ) ;
253251 self . lto_supported . store ( lto_supported, Ordering :: SeqCst ) ;
254252
255253 gccjit:: set_global_personality_function_name ( b"rust_eh_personality\0 " ) ;
@@ -279,6 +277,10 @@ impl CodegenBackend for GccCodegenBackend {
279277 }
280278 }
281279
280+ fn thin_lto_supported ( & self ) -> bool {
281+ false
282+ }
283+
282284 fn provide ( & self , providers : & mut Providers ) {
283285 providers. queries . global_backend_features =
284286 |tcx, ( ) | gcc_util:: global_gcc_features ( tcx. sess )
@@ -419,11 +421,19 @@ unsafe impl Send for SyncContext {}
419421// FIXME(antoyo): that shouldn't be Sync. Parallel compilation is currently disabled with "CodegenBackend::supports_parallel()".
420422unsafe impl Sync for SyncContext { }
421423
424+ pub struct ThinBuffer ;
425+
426+ impl ThinBufferMethods for ThinBuffer {
427+ fn data ( & self ) -> & [ u8 ] {
428+ & [ ]
429+ }
430+ }
431+
422432impl WriteBackendMethods for GccCodegenBackend {
423433 type Module = GccContext ;
424434 type TargetMachine = ( ) ;
425435 type ModuleBuffer = ModuleBuffer ;
426- type ThinData = ThinData ;
436+ type ThinData = ( ) ;
427437 type ThinBuffer = ThinBuffer ;
428438
429439 fn run_and_optimize_fat_lto (
@@ -440,16 +450,16 @@ impl WriteBackendMethods for GccCodegenBackend {
440450 }
441451
442452 fn run_thin_lto (
443- cgcx : & CodegenContext ,
444- prof : & SelfProfilerRef ,
445- dcx : DiagCtxtHandle < ' _ > ,
453+ _cgcx : & CodegenContext ,
454+ _prof : & SelfProfilerRef ,
455+ _dcx : DiagCtxtHandle < ' _ > ,
446456 // FIXME(bjorn3): Limit LTO exports to these symbols
447457 _exported_symbols_for_lto : & [ String ] ,
448- each_linked_rlib_for_lto : & [ PathBuf ] ,
449- modules : Vec < ( String , Self :: ThinBuffer ) > ,
450- cached_modules : Vec < ( SerializedModule < Self :: ModuleBuffer > , WorkProduct ) > ,
458+ _each_linked_rlib_for_lto : & [ PathBuf ] ,
459+ _modules : Vec < ( String , Self :: ThinBuffer ) > ,
460+ _cached_modules : Vec < ( SerializedModule < Self :: ModuleBuffer > , WorkProduct ) > ,
451461 ) -> ( Vec < ThinModule < Self > > , Vec < WorkProduct > ) {
452- back :: lto :: run_thin ( cgcx , prof , dcx , each_linked_rlib_for_lto , modules , cached_modules )
462+ unreachable ! ( )
453463 }
454464
455465 fn print_pass_timings ( & self ) {
@@ -471,13 +481,13 @@ impl WriteBackendMethods for GccCodegenBackend {
471481 }
472482
473483 fn optimize_thin (
474- cgcx : & CodegenContext ,
484+ _cgcx : & CodegenContext ,
475485 _prof : & SelfProfilerRef ,
476486 _shared_emitter : & SharedEmitter ,
477487 _tm_factory : TargetMachineFactoryFn < Self > ,
478- thin : ThinModule < Self > ,
488+ _thin : ThinModule < Self > ,
479489 ) -> ModuleCodegen < Self :: Module > {
480- back :: lto :: optimize_thin_module ( thin , cgcx )
490+ unreachable ! ( )
481491 }
482492
483493 fn codegen (
@@ -490,8 +500,8 @@ impl WriteBackendMethods for GccCodegenBackend {
490500 back:: write:: codegen ( cgcx, prof, shared_emitter, module, config)
491501 }
492502
493- fn prepare_thin ( module : ModuleCodegen < Self :: Module > ) -> ( String , Self :: ThinBuffer ) {
494- back :: lto :: prepare_thin ( module )
503+ fn prepare_thin ( _module : ModuleCodegen < Self :: Module > ) -> ( String , Self :: ThinBuffer ) {
504+ unreachable ! ( )
495505 }
496506
497507 fn serialize_module ( _module : ModuleCodegen < Self :: Module > ) -> ( String , Self :: ModuleBuffer ) {
0 commit comments