@@ -40,7 +40,7 @@ use tempfile::{TempDir, tempdir};
40
40
41
41
use crate :: back:: write:: save_temp_bitcode;
42
42
use crate :: errors:: { DynamicLinkingWithLTO , LtoBitcodeFromRlib , LtoDisallowed , LtoDylib } ;
43
- use crate :: { GccCodegenBackend , GccContext , SyncContext , to_gcc_opt_level} ;
43
+ use crate :: { GccCodegenBackend , GccContext , LtoMode , SyncContext , to_gcc_opt_level} ;
44
44
45
45
pub fn crate_type_allows_lto ( crate_type : CrateType ) -> bool {
46
46
match crate_type {
@@ -302,7 +302,7 @@ fn fat_lto(
302
302
info ! ( "linking {:?}" , name) ;
303
303
match bc_decoded {
304
304
SerializedModule :: Local ( ref module_buffer) => {
305
- module. module_llvm . should_combine_object_files = true ;
305
+ module. module_llvm . lto_mode = LtoMode :: Fat ;
306
306
module
307
307
. module_llvm
308
308
. context
@@ -610,7 +610,7 @@ pub fn optimize_thin_module(
610
610
// that LLVM Context and Module.
611
611
//let llcx = llvm::LLVMRustContextCreate(cgcx.fewer_names);
612
612
//let llmod_raw = parse_module(llcx, module_name, thin_module.data(), &dcx)? as *const _;
613
- let mut should_combine_object_files = false ;
613
+ let mut lto_mode = LtoMode :: None ;
614
614
let context = match thin_module. shared . thin_buffers . get ( thin_module. idx ) {
615
615
Some ( thin_buffer) => Arc :: clone ( & thin_buffer. context ) ,
616
616
None => {
@@ -621,7 +621,7 @@ pub fn optimize_thin_module(
621
621
SerializedModule :: Local ( ref module_buffer) => {
622
622
let path = module_buffer. 0 . to_str ( ) . expect ( "path" ) ;
623
623
context. add_driver_option ( path) ;
624
- should_combine_object_files = true ;
624
+ lto_mode = LtoMode :: Thin ;
625
625
/*module.module_llvm.should_combine_object_files = true;
626
626
module
627
627
.module_llvm
@@ -640,7 +640,7 @@ pub fn optimize_thin_module(
640
640
thin_module. name ( ) . to_string ( ) ,
641
641
GccContext {
642
642
context,
643
- should_combine_object_files ,
643
+ lto_mode ,
644
644
// TODO(antoyo): use the correct relocation model here.
645
645
relocation_model : RelocModel :: Pic ,
646
646
temp_dir : None ,
0 commit comments