提交 6e680e36 编写于 作者: N Niko Matsakis

deprecate old style box shape strings

上级 a6dde776
...@@ -48,10 +48,10 @@ ...@@ -48,10 +48,10 @@
const shape_i64: u8 = 7u8; const shape_i64: u8 = 7u8;
const shape_f32: u8 = 8u8; const shape_f32: u8 = 8u8;
const shape_f64: u8 = 9u8; const shape_f64: u8 = 9u8;
// (10 is currently unused, was evec) const shape_box: u8 = 10u8;
const shape_vec: u8 = 11u8; const shape_vec: u8 = 11u8;
const shape_enum: u8 = 12u8; 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_struct: u8 = 17u8;
const shape_box_fn: u8 = 18u8; const shape_box_fn: u8 = 18u8;
const shape_UNUSED: u8 = 19u8; const shape_UNUSED: u8 = 19u8;
...@@ -377,13 +377,8 @@ fn shape_of(ccx: @crate_ctxt, t: ty::t, ty_param_map: [uint]) -> [u8] { ...@@ -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]; 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) { ty::ty_uniq(mt) {
s += [shape_uniq]; s += [shape_uniq];
......
...@@ -41,9 +41,10 @@ const uint8_t SHAPE_I32 = 6u; ...@@ -41,9 +41,10 @@ const uint8_t SHAPE_I32 = 6u;
const uint8_t SHAPE_I64 = 7u; const uint8_t SHAPE_I64 = 7u;
const uint8_t SHAPE_F32 = 8u; const uint8_t SHAPE_F32 = 8u;
const uint8_t SHAPE_F64 = 9u; const uint8_t SHAPE_F64 = 9u;
const uint8_t SHAPE_BOX = 10u;
const uint8_t SHAPE_VEC = 11u; const uint8_t SHAPE_VEC = 11u;
const uint8_t SHAPE_TAG = 12u; 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_STRUCT = 17u;
const uint8_t SHAPE_BOX_FN = 18u; const uint8_t SHAPE_BOX_FN = 18u;
const uint8_t SHAPE_OBJ = 19u; const uint8_t SHAPE_OBJ = 19u;
...@@ -257,6 +258,7 @@ private: ...@@ -257,6 +258,7 @@ private:
void walk_vec0(); void walk_vec0();
void walk_tag0(); void walk_tag0();
void walk_box0(); void walk_box0();
void walk_box_old0();
void walk_uniq0(); void walk_uniq0();
void walk_struct0(); void walk_struct0();
void walk_res0(); void walk_res0();
...@@ -374,6 +376,7 @@ ctxt<T>::walk() { ...@@ -374,6 +376,7 @@ ctxt<T>::walk() {
case SHAPE_VEC: walk_vec0(); break; case SHAPE_VEC: walk_vec0(); break;
case SHAPE_TAG: walk_tag0(); break; case SHAPE_TAG: walk_tag0(); break;
case SHAPE_BOX: walk_box0(); break; case SHAPE_BOX: walk_box0(); break;
case SHAPE_BOX_OLD: walk_box_old0(); break;
case SHAPE_STRUCT: walk_struct0(); break; case SHAPE_STRUCT: walk_struct0(); break;
case SHAPE_RES: walk_res0(); break; case SHAPE_RES: walk_res0(); break;
case SHAPE_VAR: walk_var0(); break; case SHAPE_VAR: walk_var0(); break;
...@@ -482,6 +485,13 @@ ctxt<T>::walk_tag0() { ...@@ -482,6 +485,13 @@ ctxt<T>::walk_tag0() {
template<typename T> template<typename T>
void void
ctxt<T>::walk_box0() { ctxt<T>::walk_box0() {
static_cast<T *>(this)->walk_box1();
}
template<typename T>
void
ctxt<T>::walk_box_old0() {
// remove after snapshot
uint16_t sp_size = get_u16_bump(sp); uint16_t sp_size = get_u16_bump(sp);
const uint8_t *end_sp = sp + sp_size; const uint8_t *end_sp = sp + sp_size;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册