@@ -59,8 +59,6 @@ pub fn expand_asm(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
5959
6060 let mut state = Asm ;
6161
62- let mut read_write_operands = Vec :: new ( ) ;
63-
6462 ' statement: loop {
6563 match state {
6664 Asm => {
@@ -100,8 +98,6 @@ pub fn expand_asm(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
10098 let output = match constraint. get ( ) . slice_shift_char ( ) {
10199 ( Some ( '=' ) , _) => None ,
102100 ( Some ( '+' ) , operand) => {
103- // Save a reference to the output
104- read_write_operands. push ( ( outputs. len ( ) , out) ) ;
105101 Some ( token:: intern_and_get_ident ( format ! (
106102 "={}" ,
107103 operand) . as_slice ( ) ) )
@@ -112,7 +108,8 @@ pub fn expand_asm(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
112108 }
113109 } ;
114110
115- outputs. push ( ( output. unwrap_or ( constraint) , out) ) ;
111+ let is_rw = output. is_some ( ) ;
112+ outputs. push ( ( output. unwrap_or ( constraint) , out, is_rw) ) ;
116113 }
117114 }
118115 Inputs => {
@@ -202,21 +199,14 @@ pub fn expand_asm(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
202199 }
203200 }
204201
205- // Append an input operand, with the form of ("0", expr)
206- // that links to an output operand.
207- for & ( i, out) in read_write_operands. iter ( ) {
208- inputs. push ( ( token:: intern_and_get_ident ( i. to_string ( ) . as_slice ( ) ) ,
209- out) ) ;
210- }
211-
212202 MacExpr :: new ( box ( GC ) ast:: Expr {
213203 id : ast:: DUMMY_NODE_ID ,
214204 node : ast:: ExprInlineAsm ( ast:: InlineAsm {
215205 asm : token:: intern_and_get_ident ( asm. get ( ) ) ,
216206 asm_str_style : asm_str_style. unwrap ( ) ,
217- clobbers : token:: intern_and_get_ident ( cons. as_slice ( ) ) ,
218- inputs : inputs,
219207 outputs : outputs,
208+ inputs : inputs,
209+ clobbers : token:: intern_and_get_ident ( cons. as_slice ( ) ) ,
220210 volatile : volatile,
221211 alignstack : alignstack,
222212 dialect : dialect
0 commit comments