1
- use super :: command:: Command ;
2
- use super :: link:: { self , get_linker, remove} ;
1
+ use super :: link:: { self , remove} ;
3
2
use super :: linker:: LinkerInfo ;
4
3
use super :: lto:: { self , SerializedModule } ;
5
4
use super :: symbol_export:: symbol_name_for_instance_in_crate;
@@ -116,7 +115,6 @@ pub struct ModuleConfig {
116
115
pub merge_functions : bool ,
117
116
pub inline_threshold : Option < usize > ,
118
117
pub new_llvm_pass_manager : Option < bool > ,
119
- pub no_integrated_as : bool ,
120
118
}
121
119
122
120
impl ModuleConfig {
@@ -140,7 +138,6 @@ impl ModuleConfig {
140
138
emit_ir : false ,
141
139
emit_asm : false ,
142
140
emit_obj : EmitObj :: None ,
143
- no_integrated_as : false ,
144
141
145
142
verify_llvm_ir : false ,
146
143
no_prepopulate_passes : false ,
@@ -202,12 +199,6 @@ impl ModuleConfig {
202
199
}
203
200
}
204
201
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
-
211
202
// HACK(eddyb) work around `#[derive]` producing wrong bounds for `Clone`.
212
203
pub struct TargetMachineFactory < B : WriteBackendMethods > (
213
204
pub Arc < dyn Fn ( ) -> Result < B :: TargetMachine , String > + Send + Sync > ,
@@ -260,8 +251,6 @@ pub struct CodegenContext<B: WriteBackendMethods> {
260
251
pub cgu_reuse_tracker : CguReuseTracker ,
261
252
// Channel back to the main control thread to send messages to
262
253
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 > > ,
265
254
}
266
255
267
256
impl < B : WriteBackendMethods > CodegenContext < B > {
@@ -415,9 +404,6 @@ pub fn start_async_codegen<B: ExtraBackendMethods>(
415
404
416
405
modules_config. emit_pre_lto_bc = need_pre_lto_bitcode_for_incr_comp ( sess) ;
417
406
418
- modules_config. no_integrated_as =
419
- tcx. sess . opts . cg . no_integrated_as || tcx. sess . target . target . options . no_integrated_as ;
420
-
421
407
for output_type in sess. opts . output_types . keys ( ) {
422
408
match * output_type {
423
409
OutputType :: Bitcode => {
@@ -1030,17 +1016,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
1030
1016
each_linked_rlib_for_lto. push ( ( cnum, path. to_path_buf ( ) ) ) ;
1031
1017
} ) ) ;
1032
1018
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
-
1044
1019
let ol = if tcx. sess . opts . debugging_opts . no_codegen
1045
1020
|| !tcx. sess . opts . output_types . should_codegen ( )
1046
1021
{
@@ -1076,7 +1051,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
1076
1051
target_pointer_width : tcx. sess . target . target . target_pointer_width . clone ( ) ,
1077
1052
target_arch : tcx. sess . target . target . arch . clone ( ) ,
1078
1053
debuginfo : tcx. sess . opts . debuginfo ,
1079
- assembler_cmd,
1080
1054
} ;
1081
1055
1082
1056
// 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>
1610
1584
} ) ;
1611
1585
}
1612
1586
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
-
1651
1587
enum SharedEmitterMessage {
1652
1588
Diagnostic ( Diagnostic ) ,
1653
1589
InlineAsmError ( u32 , String ) ,
0 commit comments