Skip to content

Commit 0199f0a

Browse files
committed
---
yaml --- r: 48759 b: refs/heads/snap-stage3 c: 9ead7da h: refs/heads/master i: 48757: 69a0bba 48755: fc406e5 48751: b074b1d v: v3
1 parent fa11e78 commit 0199f0a

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 59dcbd9f1c04a670cb12e1127a2f1fd0898050a6
4+
refs/heads/snap-stage3: 9ead7dad934cc361f8e5e489238031c987ecfc82
55
refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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)