@@ -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 ;
@@ -278,6 +279,10 @@ impl CodegenBackend for GccCodegenBackend {
278279 }
279280 }
280281
282+ fn thin_lto_supported ( & self ) -> bool {
283+ false
284+ }
285+
281286 fn provide ( & self , providers : & mut Providers ) {
282287 providers. queries . global_backend_features =
283288 |tcx, ( ) | gcc_util:: global_gcc_features ( tcx. sess )
@@ -418,11 +423,19 @@ unsafe impl Send for SyncContext {}
418423// FIXME(antoyo): that shouldn't be Sync. Parallel compilation is currently disabled with "CodegenBackend::supports_parallel()".
419424unsafe impl Sync for SyncContext { }
420425
426+ pub struct ThinBuffer ;
427+
428+ impl ThinBufferMethods for ThinBuffer {
429+ fn data ( & self ) -> & [ u8 ] {
430+ & [ ]
431+ }
432+ }
433+
421434impl WriteBackendMethods for GccCodegenBackend {
422435 type Module = GccContext ;
423436 type TargetMachine = ( ) ;
424437 type ModuleBuffer = ModuleBuffer ;
425- type ThinData = ThinData ;
438+ type ThinData = ( ) ;
426439 type ThinBuffer = ThinBuffer ;
427440
428441 fn run_and_optimize_fat_lto (
@@ -438,15 +451,15 @@ impl WriteBackendMethods for GccCodegenBackend {
438451 }
439452
440453 fn run_thin_lto (
441- cgcx : & CodegenContext ,
442- dcx : DiagCtxtHandle < ' _ > ,
454+ _cgcx : & CodegenContext ,
455+ _dcx : DiagCtxtHandle < ' _ > ,
443456 // FIXME(bjorn3): Limit LTO exports to these symbols
444457 _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 ) > ,
458+ _each_linked_rlib_for_lto : & [ PathBuf ] ,
459+ _modules : Vec < ( String , Self :: ThinBuffer ) > ,
460+ _cached_modules : Vec < ( SerializedModule < Self :: ModuleBuffer > , WorkProduct ) > ,
448461 ) -> ( Vec < ThinModule < Self > > , Vec < WorkProduct > ) {
449- back :: lto :: run_thin ( cgcx , dcx , each_linked_rlib_for_lto , modules , cached_modules )
462+ unreachable ! ( )
450463 }
451464
452465 fn print_pass_timings ( & self ) {
@@ -467,12 +480,12 @@ impl WriteBackendMethods for GccCodegenBackend {
467480 }
468481
469482 fn optimize_thin (
470- cgcx : & CodegenContext ,
483+ _cgcx : & CodegenContext ,
471484 _shared_emitter : & SharedEmitter ,
472485 _tm_factory : TargetMachineFactoryFn < Self > ,
473- thin : ThinModule < Self > ,
486+ _thin : ThinModule < Self > ,
474487 ) -> ModuleCodegen < Self :: Module > {
475- back :: lto :: optimize_thin_module ( thin , cgcx )
488+ unreachable ! ( )
476489 }
477490
478491 fn codegen (
@@ -484,8 +497,8 @@ impl WriteBackendMethods for GccCodegenBackend {
484497 back:: write:: codegen ( cgcx, shared_emitter, module, config)
485498 }
486499
487- fn prepare_thin ( module : ModuleCodegen < Self :: Module > ) -> ( String , Self :: ThinBuffer ) {
488- back :: lto :: prepare_thin ( module )
500+ fn prepare_thin ( _module : ModuleCodegen < Self :: Module > ) -> ( String , Self :: ThinBuffer ) {
501+ unreachable ! ( )
489502 }
490503
491504 fn serialize_module ( _module : ModuleCodegen < Self :: Module > ) -> ( String , Self :: ModuleBuffer ) {
0 commit comments