Skip to content

Commit a1a939f

Browse files
committed
---
yaml --- r: 50719 b: refs/heads/try c: 9ead7da h: refs/heads/master i: 50717: 53ceb5c 50715: 77d34de 50711: 35b0b3e 50703: b4e41b8 50687: 102ab07 v: v3
1 parent 1d72c73 commit a1a939f

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 5f13e9ccc2e3328d4cd8ca49f84e6840dd998346
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: f7a2371c176663d59062ec5158f39faecba45768
5-
refs/heads/try: 59dcbd9f1c04a670cb12e1127a2f1fd0898050a6
5+
refs/heads/try: 9ead7dad934cc361f8e5e489238031c987ecfc82
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/trans/expr.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,17 +561,32 @@ fn trans_rvalue_stmt_unadjusted(bcx: block, expr: @ast::expr) -> block {
561561
clobs, volatile, alignstack) => {
562562
let mut constraints = ~[];
563563
let mut cleanups = ~[];
564+
let mut aoutputs = ~[];
564565

565566
let outputs = do outs.map |&(c, out)| {
566567
constraints.push(copy *c);
567568

568-
let outty = ty::arg {
569+
let aoutty = ty::arg {
569570
mode: ast::expl(ast::by_val),
570571
ty: expr_ty(bcx, out)
571572
};
573+
aoutputs.push(unpack_result!(bcx, {
574+
callee::trans_arg_expr(bcx, aoutty, out, &mut cleanups,
575+
None, callee::DontAutorefArg)
576+
}));
577+
578+
let e = match out.node {
579+
ast::expr_addr_of(_, e) => e,
580+
_ => fail!(~"Expression must be addr of")
581+
};
582+
583+
let outty = ty::arg {
584+
mode: ast::expl(ast::by_val),
585+
ty: expr_ty(bcx, e)
586+
};
572587
573588
unpack_result!(bcx, {
574-
callee::trans_arg_expr(bcx, outty, out, &mut cleanups,
589+
callee::trans_arg_expr(bcx, outty, e, &mut cleanups,
575590
None, callee::DontAutorefArg)
576591
})
577592
@@ -627,7 +642,7 @@ fn trans_rvalue_stmt_unadjusted(bcx: block, expr: @ast::expr) -> block {
627642
};
628643

629644
// TODO: Handle >1 outputs
630-
let op = PointerCast(bcx, output, T_ptr(val_ty(output)));
645+
let op = PointerCast(bcx, aoutputs[0], T_ptr(val_ty(output)));
631646
Store(bcx, r, op);
632647

633648
return bcx;

branches/try/src/libsyntax/ext/asm.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ pub fn expand_asm(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
7575
let out = p.parse_expr();
7676
p.expect(&token::RPAREN);
7777

78+
let out = @ast::expr {
79+
id: cx.next_id(),
80+
callee_id: cx.next_id(),
81+
span: out.span,
82+
node: ast::expr_addr_of(ast::m_mutbl, out)
83+
};
84+
7885
outputs.push((constraint, out));
7986
}
8087
}

0 commit comments

Comments
 (0)