@@ -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.
@@ -251,7 +250,6 @@ impl CodegenBackend for GccCodegenBackend {
251250 #[ cfg( feature = "master" ) ]
252251 {
253252 let lto_supported = gccjit:: is_lto_supported ( ) ;
254- LTO_SUPPORTED . store ( lto_supported, Ordering :: SeqCst ) ;
255253 self . lto_supported . store ( lto_supported, Ordering :: SeqCst ) ;
256254
257255 gccjit:: set_global_personality_function_name ( b"rust_eh_personality\0 " ) ;
@@ -281,6 +279,10 @@ impl CodegenBackend for GccCodegenBackend {
281279 }
282280 }
283281
282+ fn thin_lto_supported ( & self ) -> bool {
283+ false
284+ }
285+
284286 fn provide ( & self , providers : & mut Providers ) {
285287 providers. queries . global_backend_features =
286288 |tcx, ( ) | gcc_util:: global_gcc_features ( tcx. sess )
@@ -421,11 +423,19 @@ unsafe impl Send for SyncContext {}
421423// FIXME(antoyo): that shouldn't be Sync. Parallel compilation is currently disabled with "CodegenBackend::supports_parallel()".
422424unsafe impl Sync for SyncContext { }
423425
426+ pub struct ThinBuffer ;
427+
428+ impl ThinBufferMethods for ThinBuffer {
429+ fn data ( & self ) -> & [ u8 ] {
430+ & [ ]
431+ }
432+ }
433+
424434impl WriteBackendMethods for GccCodegenBackend {
425435 type Module = GccContext ;
426436 type TargetMachine = ( ) ;
427437 type ModuleBuffer = ModuleBuffer ;
428- type ThinData = ThinData ;
438+ type ThinData = ( ) ;
429439 type ThinBuffer = ThinBuffer ;
430440
431441 fn run_and_optimize_fat_lto (
@@ -442,16 +452,16 @@ impl WriteBackendMethods for GccCodegenBackend {
442452 }
443453
444454 fn run_thin_lto (
445- cgcx : & CodegenContext ,
446- prof : & SelfProfilerRef ,
447- dcx : DiagCtxtHandle < ' _ > ,
455+ _cgcx : & CodegenContext ,
456+ _prof : & SelfProfilerRef ,
457+ _dcx : DiagCtxtHandle < ' _ > ,
448458 // FIXME(bjorn3): Limit LTO exports to these symbols
449459 _exported_symbols_for_lto : & [ String ] ,
450- each_linked_rlib_for_lto : & [ PathBuf ] ,
451- modules : Vec < ( String , Self :: ThinBuffer ) > ,
452- cached_modules : Vec < ( SerializedModule < Self :: ModuleBuffer > , WorkProduct ) > ,
460+ _each_linked_rlib_for_lto : & [ PathBuf ] ,
461+ _modules : Vec < ( String , Self :: ThinBuffer ) > ,
462+ _cached_modules : Vec < ( SerializedModule < Self :: ModuleBuffer > , WorkProduct ) > ,
453463 ) -> ( Vec < ThinModule < Self > > , Vec < WorkProduct > ) {
454- back :: lto :: run_thin ( cgcx , prof , dcx , each_linked_rlib_for_lto , modules , cached_modules )
464+ unreachable ! ( )
455465 }
456466
457467 fn print_pass_timings ( & self ) {
@@ -473,13 +483,13 @@ impl WriteBackendMethods for GccCodegenBackend {
473483 }
474484
475485 fn optimize_thin (
476- cgcx : & CodegenContext ,
486+ _cgcx : & CodegenContext ,
477487 _prof : & SelfProfilerRef ,
478488 _shared_emitter : & SharedEmitter ,
479489 _tm_factory : TargetMachineFactoryFn < Self > ,
480- thin : ThinModule < Self > ,
490+ _thin : ThinModule < Self > ,
481491 ) -> ModuleCodegen < Self :: Module > {
482- back :: lto :: optimize_thin_module ( thin , cgcx )
492+ unreachable ! ( )
483493 }
484494
485495 fn codegen (
@@ -492,8 +502,8 @@ impl WriteBackendMethods for GccCodegenBackend {
492502 back:: write:: codegen ( cgcx, prof, shared_emitter, module, config)
493503 }
494504
495- fn prepare_thin ( module : ModuleCodegen < Self :: Module > ) -> ( String , Self :: ThinBuffer ) {
496- back :: lto :: prepare_thin ( module )
505+ fn prepare_thin ( _module : ModuleCodegen < Self :: Module > ) -> ( String , Self :: ThinBuffer ) {
506+ unreachable ! ( )
497507 }
498508
499509 fn serialize_module ( _module : ModuleCodegen < Self :: Module > ) -> ( String , Self :: ModuleBuffer ) {
0 commit comments