diff options
| author | bors <bors@rust-lang.org> | 2015-12-14 13:48:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-12-14 13:48:41 +0000 |
| commit | 50a02b43ba17bf1547b7124dff909604e967a7f6 (patch) | |
| tree | 04c161e2e0556bca5bc5e4508847f2bbbae5b480 /src/libsyntax/ext | |
| parent | 6b3a3f270219819f8f98c2b6807ff70b92a941ac (diff) | |
| parent | 65707dfc001b4dea745a040c2ecc61847ccba608 (diff) | |
| download | rust-50a02b43ba17bf1547b7124dff909604e967a7f6.tar.gz rust-50a02b43ba17bf1547b7124dff909604e967a7f6.zip | |
Auto merge of #29735 - Amanieu:asm_indirect_constraint, r=pnkfelix
This PR reverts #29543 and instead implements proper support for "=*m" and "+*m" indirect output operands. This provides a framework on top of which support for plain memory operands ("m", "=m" and "+m") can be implemented.
This also fixes the liveness analysis pass not handling read/write operands correctly.
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/asm.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libsyntax/ext/asm.rs b/src/libsyntax/ext/asm.rs index d968858f634..b4f29f83726 100644 --- a/src/libsyntax/ext/asm.rs +++ b/src/libsyntax/ext/asm.rs @@ -125,7 +125,13 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) }; let is_rw = output.is_some(); - outputs.push((output.unwrap_or(constraint), out, is_rw)); + let is_indirect = constraint.contains("*"); + outputs.push(ast::InlineAsmOutput { + constraint: output.unwrap_or(constraint), + expr: out, + is_rw: is_rw, + is_indirect: is_indirect, + }); } } Inputs => { @@ -139,9 +145,9 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) let (constraint, _str_style) = panictry!(p.parse_str()); - if constraint.starts_with("=") && !constraint.contains("*") { + if constraint.starts_with("=") { cx.span_err(p.last_span, "input operand constraint contains '='"); - } else if constraint.starts_with("+") && !constraint.contains("*") { + } else if constraint.starts_with("+") { cx.span_err(p.last_span, "input operand constraint contains '+'"); } |
