Skip to content

Commit 8bf0033

Browse files
committed
Remove unused shape fields from typedescs
1 parent 179ce39 commit 8bf0033

File tree

7 files changed

+11
-27
lines changed

7 files changed

+11
-27
lines changed

src/librustc/back/abi.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ pub static tydesc_field_take_glue: uint = 2u;
4949
pub static tydesc_field_drop_glue: uint = 3u;
5050
pub static tydesc_field_free_glue: uint = 4u;
5151
pub static tydesc_field_visit_glue: uint = 5u;
52-
pub static tydesc_field_shape: uint = 6u;
53-
pub static tydesc_field_shape_tables: uint = 7u;
54-
pub static n_tydesc_fields: uint = 8u;
52+
pub static n_tydesc_fields: uint = 6u;
5553

5654
// The two halves of a closure: code and environment.
5755
pub static fn_field_code: uint = 0u;

src/librustc/middle/trans/glue.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -765,19 +765,13 @@ pub fn emit_tydescs(ccx: &mut CrateContext) {
765765
}
766766
};
767767

768-
769-
let shape = C_null(Type::i8p());
770-
let shape_tables = C_null(Type::i8p());
771-
772768
let tydesc = C_named_struct(ccx.tydesc_type,
773-
[ti.size, // size
774-
ti.align, // align
775-
take_glue, // take_glue
776-
drop_glue, // drop_glue
777-
free_glue, // free_glue
778-
visit_glue, // visit_glue
779-
shape, // shape
780-
shape_tables]); // shape_tables
769+
[ti.size, // size
770+
ti.align, // align
771+
take_glue, // take_glue
772+
drop_glue, // drop_glue
773+
free_glue, // free_glue
774+
visit_glue]); // visit_glue
781775

782776
unsafe {
783777
let gvar = ti.tydesc;

src/librustc/middle/trans/type_.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ impl Type {
211211

212212
let elems = [
213213
int_ty, int_ty,
214-
glue_fn_ty, glue_fn_ty, glue_fn_ty, glue_fn_ty,
215-
pvoid, pvoid
214+
glue_fn_ty, glue_fn_ty, glue_fn_ty, glue_fn_ty
216215
];
217216

218217
tydesc.set_struct_body(elems, false);

src/libstd/unstable/intrinsics.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ pub struct TyDesc {
4848
drop_glue: GlueFn,
4949
free_glue: GlueFn,
5050
visit_glue: GlueFn,
51-
shape: *i8,
52-
shape_tables: *i8
5351
}
5452

5553
#[lang="opaque"]

src/rt/rust_builtin.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -732,10 +732,9 @@ rust_task_deref(rust_task *task) {
732732
// Must call on rust stack.
733733
extern "C" CDECL void
734734
rust_call_tydesc_glue(void *root, size_t *tydesc, size_t glue_index) {
735-
void (*glue_fn)(void *, void *, void *) =
736-
(void (*)(void *, void *, void *))tydesc[glue_index];
737-
if (glue_fn)
738-
glue_fn(0, 0, root);
735+
glue_fn *fn = (glue_fn*) tydesc[glue_index];
736+
if (fn)
737+
fn(0, 0, root);
739738
}
740739

741740
// Don't run on the Rust stack!

src/rt/rust_type.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ struct type_desc {
5757
glue_fn *drop_glue;
5858
glue_fn *free_glue;
5959
glue_fn *visit_glue;
60-
const uint8_t *unused;
61-
const uint8_t *unused2;
6260
};
6361

6462
extern "C" type_desc *rust_clone_type_desc(type_desc*);

src/rt/rust_util.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ struct type_desc str_body_tydesc = {
2121
NULL, // drop_glue
2222
NULL, // free_glue
2323
NULL, // visit_glue
24-
NULL, // shape
25-
NULL, // shape_tables
2624
};
2725

2826
//

0 commit comments

Comments
 (0)