aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2010-12-02 17:16:42 -0800
committerPatrick Walton <[email protected]>2010-12-02 17:18:06 -0800
commit49b3cd700ee6bd4b68346144129886478246311c (patch)
tree0f39502f627226884001cd3b1ca517d4d175cd41
parentAdd ty_boxed to typeck.type_is_boxed. (diff)
downloadrust-49b3cd700ee6bd4b68346144129886478246311c.tar.xz
rust-49b3cd700ee6bd4b68346144129886478246311c.zip
rustc: Remove the premature optimization for nullary tag constructors, since it'll be no longer necessary once LLVM gets a unit type
-rw-r--r--src/comp/middle/trans.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 3c06274f..f73366f0 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -44,7 +44,7 @@ type glue_fns = rec(ValueRef activate_glue,
ValueRef exit_task_glue,
vec[ValueRef] upcall_glues);
-tag arity { nullary; n_ary(uint); }
+tag arity { nullary; n_ary; }
type tag_info = rec(type_handle th,
mutable vec[tup(ast.def_id,arity)] variants);
@@ -1141,7 +1141,7 @@ fn trans_name(@block_ctxt cx, &ast.name n, &option.t[ast.def] dopt)
auto elems = vec(C_int(i));
ret tup(res(cx, C_struct(elems)), false);
}
- case (n_ary(_)) {
+ case (n_ary) {
cx.fcx.ccx.sess.unimpl("n-ary tag " +
"constructor in " +
"trans");
@@ -1746,10 +1746,9 @@ fn resolve_tag_types_for_item(&@crate_ctxt cx, @ast.item i) -> @crate_ctxt {
}
variant_tys += vec(T_struct(lltys));
-
- arity_info = n_ary(n_ary_idx);
- n_ary_idx += 1u;
+ arity_info = n_ary;
} else {
+ variant_tys += vec(T_nil());
arity_info = nullary;
}