Skip to content

Commit c861166

Browse files
committed
---
yaml --- r: 1650 b: refs/heads/master c: 2a66294 h: refs/heads/master v: v3
1 parent 3405e36 commit c861166

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 9fc4db6b89213afdf45c02fc2bd2be62b0ddc40c
2+
refs/heads/master: 2a662944a4d87c6d82299a181996ba14170b2ebb

trunk/src/comp/middle/trans.rs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2683,18 +2683,7 @@ fn trans_if(@block_ctxt cx, @ast.expr cond,
26832683

26842684
alt (els) {
26852685
case (some[@ast.expr](?elexpr)) {
2686-
// FIXME: Shouldn't need to unwrap the block here,
2687-
// instead just use 'else_res = trans_expr(else_cx, elexpr)',
2688-
// but either a) trans_expr doesn't handle expr_block
2689-
// correctly or b) I have no idea what I'm doing...
2690-
alt (elexpr.node) {
2691-
case (ast.expr_if(_, _, _, _)) {
2692-
else_res = trans_expr(else_cx, elexpr);
2693-
}
2694-
case (ast.expr_block(?b, _)) {
2695-
else_res = trans_block(else_cx, b);
2696-
}
2697-
}
2686+
else_res = trans_expr(else_cx, elexpr);
26982687
}
26992688
case (_) { /* fall through */ }
27002689
}
@@ -3942,14 +3931,7 @@ fn trans_expr(@block_ctxt cx, @ast.expr e) -> result {
39423931
}
39433932

39443933
case (ast.expr_block(?blk, _)) {
3945-
auto sub_cx = new_scope_block_ctxt(cx, "block-expr body");
3946-
auto next_cx = new_sub_block_ctxt(cx, "next");
3947-
auto sub = trans_block(sub_cx, blk);
3948-
3949-
cx.build.Br(sub_cx.llbb);
3950-
sub.bcx.build.Br(next_cx.llbb);
3951-
3952-
ret res(next_cx, sub.val);
3934+
ret trans_block(cx, blk);
39533935
}
39543936

39553937
case (ast.expr_assign(?dst, ?src, ?ann)) {

0 commit comments

Comments
 (0)