@@ -59,8 +59,6 @@ pub fn expand_asm(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
59
59
60
60
let mut state = Asm ;
61
61
62
- let mut read_write_operands = Vec :: new ( ) ;
63
-
64
62
' statement: loop {
65
63
match state {
66
64
Asm => {
@@ -100,8 +98,6 @@ pub fn expand_asm(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
100
98
let output = match constraint. get ( ) . slice_shift_char ( ) {
101
99
( Some ( '=' ) , _) => None ,
102
100
( Some ( '+' ) , operand) => {
103
- // Save a reference to the output
104
- read_write_operands. push ( ( outputs. len ( ) , out) ) ;
105
101
Some ( token:: intern_and_get_ident ( format ! (
106
102
"={}" ,
107
103
operand) . as_slice ( ) ) )
@@ -112,7 +108,8 @@ pub fn expand_asm(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
112
108
}
113
109
} ;
114
110
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) ) ;
116
113
}
117
114
}
118
115
Inputs => {
@@ -202,21 +199,14 @@ pub fn expand_asm(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
202
199
}
203
200
}
204
201
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
-
212
202
MacExpr :: new ( box ( GC ) ast:: Expr {
213
203
id : ast:: DUMMY_NODE_ID ,
214
204
node : ast:: ExprInlineAsm ( ast:: InlineAsm {
215
205
asm : token:: intern_and_get_ident ( asm. get ( ) ) ,
216
206
asm_str_style : asm_str_style. unwrap ( ) ,
217
- clobbers : token:: intern_and_get_ident ( cons. as_slice ( ) ) ,
218
- inputs : inputs,
219
207
outputs : outputs,
208
+ inputs : inputs,
209
+ clobbers : token:: intern_and_get_ident ( cons. as_slice ( ) ) ,
220
210
volatile : volatile,
221
211
alignstack : alignstack,
222
212
dialect : dialect
0 commit comments