From 6e680e36a70e94f307928fee1c99b29a28eeba6e Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 8 Feb 2012 12:06:08 -0800 Subject: [PATCH] deprecate old style box shape strings --- src/comp/middle/shape.rs | 11 +++-------- src/rt/rust_shape.h | 12 +++++++++++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/comp/middle/shape.rs b/src/comp/middle/shape.rs index f1f7ddaf7b8..587c5c29ca3 100644 --- a/src/comp/middle/shape.rs +++ b/src/comp/middle/shape.rs @@ -48,10 +48,10 @@ const shape_i32: u8 = 6u8; const shape_i64: u8 = 7u8; const shape_f32: u8 = 8u8; const shape_f64: u8 = 9u8; -// (10 is currently unused, was evec) +const shape_box: u8 = 10u8; const shape_vec: u8 = 11u8; const shape_enum: u8 = 12u8; -const shape_box: u8 = 13u8; +const shape_box_old: u8 = 13u8; // deprecated, remove after snapshot const shape_struct: u8 = 17u8; const shape_box_fn: u8 = 18u8; const shape_UNUSED: u8 = 19u8; @@ -377,13 +377,8 @@ fn shape_of(ccx: @crate_ctxt, t: ty::t, ty_param_map: [uint]) -> [u8] { } } } - ty::ty_box(mt) { + ty::ty_box(_) | ty::ty_opaque_box { s += [shape_box]; - add_substr(s, shape_of(ccx, mt.ty, ty_param_map)); - } - ty::ty_opaque_box { - s += [shape_box]; - add_substr(s, [shape_u8]); } ty::ty_uniq(mt) { s += [shape_uniq]; diff --git a/src/rt/rust_shape.h b/src/rt/rust_shape.h index 675d67f12d4..99c40164f49 100644 --- a/src/rt/rust_shape.h +++ b/src/rt/rust_shape.h @@ -41,9 +41,10 @@ const uint8_t SHAPE_I32 = 6u; const uint8_t SHAPE_I64 = 7u; const uint8_t SHAPE_F32 = 8u; const uint8_t SHAPE_F64 = 9u; +const uint8_t SHAPE_BOX = 10u; const uint8_t SHAPE_VEC = 11u; const uint8_t SHAPE_TAG = 12u; -const uint8_t SHAPE_BOX = 13u; +const uint8_t SHAPE_BOX_OLD = 13u; // remove after snapshot const uint8_t SHAPE_STRUCT = 17u; const uint8_t SHAPE_BOX_FN = 18u; const uint8_t SHAPE_OBJ = 19u; @@ -257,6 +258,7 @@ private: void walk_vec0(); void walk_tag0(); void walk_box0(); + void walk_box_old0(); void walk_uniq0(); void walk_struct0(); void walk_res0(); @@ -374,6 +376,7 @@ ctxt::walk() { case SHAPE_VEC: walk_vec0(); break; case SHAPE_TAG: walk_tag0(); break; case SHAPE_BOX: walk_box0(); break; + case SHAPE_BOX_OLD: walk_box_old0(); break; case SHAPE_STRUCT: walk_struct0(); break; case SHAPE_RES: walk_res0(); break; case SHAPE_VAR: walk_var0(); break; @@ -482,6 +485,13 @@ ctxt::walk_tag0() { template void ctxt::walk_box0() { + static_cast(this)->walk_box1(); +} + +template +void +ctxt::walk_box_old0() { + // remove after snapshot uint16_t sp_size = get_u16_bump(sp); const uint8_t *end_sp = sp + sp_size;