Skip to content

Commit 9952e3c

Browse files
committed
---
yaml --- r: 49967 b: refs/heads/auto c: 9ead7da h: refs/heads/master i: 49965: 2d068e2 49963: e3bb737 49959: 312a02e 49951: 1c275d3 v: v3
1 parent 65c59c8 commit 9952e3c

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
@@ -14,5 +14,5 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 59dcbd9f1c04a670cb12e1127a2f1fd0898050a6
17+
refs/heads/auto: 9ead7dad934cc361f8e5e489238031c987ecfc82
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167

branches/auto/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/auto/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)