1- use super :: command:: Command ;
2- use super :: link:: { self , get_linker, remove} ;
1+ use super :: link:: { self , remove} ;
32use super :: linker:: LinkerInfo ;
43use super :: lto:: { self , SerializedModule } ;
54use super :: symbol_export:: symbol_name_for_instance_in_crate;
@@ -116,7 +115,6 @@ pub struct ModuleConfig {
116115 pub merge_functions : bool ,
117116 pub inline_threshold : Option < usize > ,
118117 pub new_llvm_pass_manager : Option < bool > ,
119- pub no_integrated_as : bool ,
120118}
121119
122120impl ModuleConfig {
@@ -140,7 +138,6 @@ impl ModuleConfig {
140138 emit_ir : false ,
141139 emit_asm : false ,
142140 emit_obj : EmitObj :: None ,
143- no_integrated_as : false ,
144141
145142 verify_llvm_ir : false ,
146143 no_prepopulate_passes : false ,
@@ -202,12 +199,6 @@ impl ModuleConfig {
202199 }
203200}
204201
205- /// Assembler name and command used by codegen when no_integrated_as is enabled
206- pub struct AssemblerCommand {
207- name : PathBuf ,
208- cmd : Command ,
209- }
210-
211202// HACK(eddyb) work around `#[derive]` producing wrong bounds for `Clone`.
212203pub struct TargetMachineFactory < B : WriteBackendMethods > (
213204 pub Arc < dyn Fn ( ) -> Result < B :: TargetMachine , String > + Send + Sync > ,
@@ -260,8 +251,6 @@ pub struct CodegenContext<B: WriteBackendMethods> {
260251 pub cgu_reuse_tracker : CguReuseTracker ,
261252 // Channel back to the main control thread to send messages to
262253 pub coordinator_send : Sender < Box < dyn Any + Send > > ,
263- // The assembler command if no_integrated_as option is enabled, None otherwise
264- pub assembler_cmd : Option < Arc < AssemblerCommand > > ,
265254}
266255
267256impl < B : WriteBackendMethods > CodegenContext < B > {
@@ -415,9 +404,6 @@ pub fn start_async_codegen<B: ExtraBackendMethods>(
415404
416405 modules_config. emit_pre_lto_bc = need_pre_lto_bitcode_for_incr_comp ( sess) ;
417406
418- modules_config. no_integrated_as =
419- tcx. sess . opts . cg . no_integrated_as || tcx. sess . target . target . options . no_integrated_as ;
420-
421407 for output_type in sess. opts . output_types . keys ( ) {
422408 match * output_type {
423409 OutputType :: Bitcode => {
@@ -1030,17 +1016,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
10301016 each_linked_rlib_for_lto. push ( ( cnum, path. to_path_buf ( ) ) ) ;
10311017 } ) ) ;
10321018
1033- let assembler_cmd = if modules_config. no_integrated_as {
1034- // HACK: currently we use linker (gcc) as our assembler
1035- let ( linker, flavor) = link:: linker_and_flavor ( sess) ;
1036-
1037- let ( name, mut cmd) = get_linker ( sess, & linker, flavor) ;
1038- cmd. args ( & sess. target . target . options . asm_args ) ;
1039- Some ( Arc :: new ( AssemblerCommand { name, cmd } ) )
1040- } else {
1041- None
1042- } ;
1043-
10441019 let ol = if tcx. sess . opts . debugging_opts . no_codegen
10451020 || !tcx. sess . opts . output_types . should_codegen ( )
10461021 {
@@ -1076,7 +1051,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
10761051 target_pointer_width : tcx. sess . target . target . target_pointer_width . clone ( ) ,
10771052 target_arch : tcx. sess . target . target . arch . clone ( ) ,
10781053 debuginfo : tcx. sess . opts . debuginfo ,
1079- assembler_cmd,
10801054 } ;
10811055
10821056 // This is the "main loop" of parallel work happening for parallel codegen.
@@ -1610,44 +1584,6 @@ fn spawn_work<B: ExtraBackendMethods>(cgcx: CodegenContext<B>, work: WorkItem<B>
16101584 } ) ;
16111585}
16121586
1613- pub fn run_assembler < B : ExtraBackendMethods > (
1614- cgcx : & CodegenContext < B > ,
1615- handler : & Handler ,
1616- assembly : & Path ,
1617- object : & Path ,
1618- ) {
1619- let assembler = cgcx. assembler_cmd . as_ref ( ) . expect ( "cgcx.assembler_cmd is missing?" ) ;
1620-
1621- let pname = & assembler. name ;
1622- let mut cmd = assembler. cmd . clone ( ) ;
1623- cmd. arg ( "-c" ) . arg ( "-o" ) . arg ( object) . arg ( assembly) ;
1624- debug ! ( "{:?}" , cmd) ;
1625-
1626- match cmd. output ( ) {
1627- Ok ( prog) => {
1628- if !prog. status . success ( ) {
1629- let mut note = prog. stderr . clone ( ) ;
1630- note. extend_from_slice ( & prog. stdout ) ;
1631-
1632- handler
1633- . struct_err ( & format ! (
1634- "linking with `{}` failed: {}" ,
1635- pname. display( ) ,
1636- prog. status
1637- ) )
1638- . note ( & format ! ( "{:?}" , & cmd) )
1639- . note ( str:: from_utf8 ( & note[ ..] ) . unwrap ( ) )
1640- . emit ( ) ;
1641- handler. abort_if_errors ( ) ;
1642- }
1643- }
1644- Err ( e) => {
1645- handler. err ( & format ! ( "could not exec the linker `{}`: {}" , pname. display( ) , e) ) ;
1646- handler. abort_if_errors ( ) ;
1647- }
1648- }
1649- }
1650-
16511587enum SharedEmitterMessage {
16521588 Diagnostic ( Diagnostic ) ,
16531589 InlineAsmError ( u32 , String ) ,
0 commit comments