@@ -61,7 +61,6 @@ type glue_fns = rec(ValueRef activate_glue,
61
61
62
62
type tag_info = rec (
63
63
type_handle th,
64
- mutable uint size,
65
64
mutable @hashmap[ ast. def_id, ValueRef ] lldiscrims
66
65
) ;
67
66
@@ -4491,15 +4490,6 @@ fn trans_tag_variant(@crate_ctxt cx, ast.def_id tag_id,
4491
4490
auto arg_tys = arg_tys_of_fn( variant. ann) ;
4492
4491
copy_args_to_allocas( bcx, none[ TypeRef ] , fn_args, arg_tys) ;
4493
4492
4494
- // FIXME: This is wrong for generic tags. We should be dynamically
4495
- // computing "size" below based on the tydescs passed in.
4496
- auto info = cx. tags. get( mk_plain_tag( tag_id) ) ;
4497
-
4498
- auto lltagty = T_struct ( vec( T_int ( ) , T_array ( T_i8 ( ) , info. size) ) ) ;
4499
-
4500
- // FIXME: better name.
4501
- llvm. LLVMAddTypeName ( cx. llmod, _str. buf( "tag" ) , lltagty) ;
4502
-
4503
4493
auto lldiscrimptr = bcx. build. GEP ( fcx. llretptr,
4504
4494
vec( C_int ( 0 ) , C_int ( 0 ) ) ) ;
4505
4495
bcx. build. Store ( C_int ( index) , lldiscrimptr) ;
@@ -4718,7 +4708,6 @@ fn collect_item(&@crate_ctxt cx, @ast.item i) -> @crate_ctxt {
4718
4708
4719
4709
auto info = @rec(
4720
4710
th=mk_type_handle( ) ,
4721
- mutable size=0 u,
4722
4711
mutable lldiscrims=@new_def_hash[ ValueRef ] ( )
4723
4712
) ;
4724
4713
@@ -4780,6 +4769,9 @@ fn collect_tag_ctors(@crate_ctxt cx, @ast.crate crate) {
4780
4769
fn resolve_tag_types_for_item( & @crate_ctxt cx, @ast. item i) -> @crate_ctxt {
4781
4770
alt ( i. node) {
4782
4771
case ( ast. item_tag( _, ?variants, _, ?tag_id) ) {
4772
+ // FIXME: This is all wrong. Now sizes and alignments are computed
4773
+ // dynamically instead of up front.
4774
+
4783
4775
auto max_align = 0 u;
4784
4776
auto max_size = 0 u;
4785
4777
@@ -4799,8 +4791,6 @@ fn resolve_tag_types_for_item(&@crate_ctxt cx, @ast.item i) -> @crate_ctxt {
4799
4791
}
4800
4792
}
4801
4793
4802
- info. size = max_size;
4803
-
4804
4794
// FIXME: alignment is wrong here, manually insert padding I
4805
4795
// guess :(
4806
4796
auto tag_ty = T_struct ( vec ( T_int ( ) , T_array ( T_i8 ( ) , max_size) ) ) ;
0 commit comments