aboutsummaryrefslogtreecommitdiff
path: root/src/comp/middle/trans.rs
diff options
context:
space:
mode:
authorBrian Anderson <[email protected]>2011-01-30 17:18:19 -0500
committerGraydon Hoare <[email protected]>2011-02-10 12:12:10 -0800
commit378c0087ca7572cd17726c704fe04d57bf4687af (patch)
treec158d769375cee5b19b4be83d314c46acab28b12 /src/comp/middle/trans.rs
parentRevert EI_OSABI ELF header field back to 0 for Linux (diff)
downloadrust-378c0087ca7572cd17726c704fe04d57bf4687af.tar.xz
rust-378c0087ca7572cd17726c704fe04d57bf4687af.zip
Parse 'be' statement. Pass tailcall tests. No actual tailcalls yet.
Diffstat (limited to 'src/comp/middle/trans.rs')
-rw-r--r--src/comp/middle/trans.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 2a9c32da..499ab027 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -3128,6 +3128,11 @@ fn trans_ret(@block_ctxt cx, &option.t[@ast.expr] e) -> result {
ret res(bcx, C_nil());
}
+fn trans_be(@block_ctxt cx, @ast.expr e) -> result {
+ // FIXME: So this isn't actually a tail call
+ ret trans_ret(cx, some(e));
+}
+
fn init_local(@block_ctxt cx, @ast.local local) -> result {
// Make a note to drop this slot on the way out.
@@ -3178,6 +3183,10 @@ fn trans_stmt(@block_ctxt cx, &ast.stmt s) -> result {
bcx = trans_ret(cx, e).bcx;
}
+ case (ast.stmt_be(?e)) {
+ bcx = trans_be(cx, e).bcx;
+ }
+
case (ast.stmt_expr(?e)) {
bcx = trans_expr(cx, e).bcx;
}