@@ -87,6 +87,8 @@ pub fn compile_codegen_unit<'tcx>(tcx: TyCtxt<'tcx>, cgu_name: Symbol, supports_
8787 // Instantiate monomorphizations without filling out definitions yet...
8888 //let llvm_module = ModuleLlvm::new(tcx, &cgu_name.as_str());
8989 let context = Context :: default ( ) ;
90+ // TODO(antoyo): only set on x86 platforms.
91+ context. add_command_line_option ( "-masm=intel" ) ;
9092 // TODO(antoyo): only add the following cli argument if the feature is supported.
9193 context. add_command_line_option ( "-msse2" ) ;
9294 context. add_command_line_option ( "-mavx2" ) ;
@@ -109,20 +111,8 @@ pub fn compile_codegen_unit<'tcx>(tcx: TyCtxt<'tcx>, cgu_name: Symbol, supports_
109111 context. add_command_line_option ( "-mvpclmulqdq" ) ;
110112 context. add_command_line_option ( "-mavx" ) ;
111113
112- let mut has_set_asm_syntax = false ;
113114 for arg in & tcx. sess . opts . cg . llvm_args {
114- if arg. starts_with ( "--x86-asm-syntax=" ) {
115- // LLVM uses the two same arguments as GCC: `att` and `intel`.
116- let syntax = arg. splitn ( 2 , '=' ) . skip ( 1 ) . next ( ) . expect ( "missing argument" ) ;
117- context. add_command_line_option ( & format ! ( "-masm={}" , syntax) ) ;
118- has_set_asm_syntax = true ;
119- } else {
120- context. add_command_line_option ( arg) ;
121- }
122- }
123- if !has_set_asm_syntax {
124- // TODO(antoyo): only set on x86 platforms.
125- context. add_command_line_option ( "-masm=intel" ) ;
115+ context. add_command_line_option ( arg) ;
126116 }
127117 // NOTE: This is needed to compile the file src/intrinsic/archs.rs during a bootstrap of rustc.
128118 context. add_command_line_option ( "-fno-var-tracking-assignments" ) ;
0 commit comments