diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2013-10-17 21:24:41 +0300 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2013-10-18 08:02:56 +0300 |
| commit | 7ab0b0cd41fc4bf567694ebedb2d927da9bf2551 (patch) | |
| tree | b0bfa1320b69df8771527fcb4d944d9275b38e8d /src/libsyntax/ext | |
| parent | 737413d72a714e55ff53e591e8190b490c194a53 (diff) | |
| download | rust-7ab0b0cd41fc4bf567694ebedb2d927da9bf2551.tar.gz rust-7ab0b0cd41fc4bf567694ebedb2d927da9bf2551.zip | |
Handle inline asm outputs as write-only in liveness, borrowck and trans.
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/asm.rs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/libsyntax/ext/asm.rs b/src/libsyntax/ext/asm.rs index e836367555a..f4b1c7f1f06 100644 --- a/src/libsyntax/ext/asm.rs +++ b/src/libsyntax/ext/asm.rs @@ -75,16 +75,18 @@ pub fn expand_asm(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree]) } let (constraint, _str_style) = p.parse_str(); + + if constraint.starts_with("+") { + cx.span_unimpl(*p.last_span, + "'+' (read+write) output operand constraint modifier"); + } else if !constraint.starts_with("=") { + cx.span_err(*p.last_span, "output operand constraint lacks '='"); + } + p.expect(&token::LPAREN); let out = p.parse_expr(); p.expect(&token::RPAREN); - let out = @ast::Expr { - id: ast::DUMMY_NODE_ID, - span: out.span, - node: ast::ExprAddrOf(ast::MutMutable, out) - }; - outputs.push((constraint, out)); } } @@ -98,6 +100,13 @@ pub fn expand_asm(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree]) } let (constraint, _str_style) = p.parse_str(); + + if constraint.starts_with("=") { + cx.span_err(*p.last_span, "input operand constraint contains '='"); + } else if constraint.starts_with("+") { + cx.span_err(*p.last_span, "input operand constraint contains '+'"); + } + p.expect(&token::LPAREN); let input = p.parse_expr(); p.expect(&token::RPAREN); |
