Skip to content

Commit b9714f2

Browse files
committed
GC the now-unused old layout helpers
1 parent bf5a462 commit b9714f2

File tree

2 files changed

+0
-46
lines changed

2 files changed

+0
-46
lines changed

src/librustc/middle/trans/base.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -250,25 +250,6 @@ pub fn bump_ptr(bcx: block, t: ty::t, base: ValueRef, sz: ValueRef) ->
250250
PointerCast(bcx, bumped, typ)
251251
}
252252

253-
// Replacement for the LLVM 'GEP' instruction when field indexing into a enum.
254-
// @llblobptr is the data part of a enum value; its actual type
255-
// is meaningless, as it will be cast away.
256-
pub fn GEP_enum(bcx: block, llblobptr: ValueRef, enum_id: ast::def_id,
257-
variant_id: ast::def_id, ty_substs: ~[ty::t],
258-
ix: uint) -> ValueRef {
259-
let _icx = bcx.insn_ctxt("GEP_enum");
260-
let ccx = bcx.ccx();
261-
let variant = ty::enum_variant_with_id(ccx.tcx, enum_id, variant_id);
262-
assert ix < variant.args.len();
263-
264-
let arg_lltys = vec::map(variant.args, |aty| {
265-
type_of(ccx, ty::subst_tps(ccx.tcx, ty_substs, None, *aty))
266-
});
267-
let typed_blobptr = PointerCast(bcx, llblobptr,
268-
T_ptr(T_struct(arg_lltys)));
269-
GEPi(bcx, typed_blobptr, [0u, ix])
270-
}
271-
272253
// Returns a pointer to the body for the box. The box may be an opaque
273254
// box. The result will be casted to the type of body_t, if it is statically
274255
// known.

src/librustc/middle/trans/common.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,21 +1046,6 @@ pub fn T_enum_discrim(cx: @CrateContext) -> TypeRef {
10461046
return cx.int_type;
10471047
}
10481048

1049-
pub fn T_opaque_enum(cx: @CrateContext) -> TypeRef {
1050-
let s = @"opaque_enum";
1051-
match name_has_type(cx.tn, s) {
1052-
Some(t) => return t,
1053-
_ => ()
1054-
}
1055-
let t = T_struct(~[T_enum_discrim(cx), T_i8()]);
1056-
associate_type(cx.tn, s, t);
1057-
return t;
1058-
}
1059-
1060-
pub fn T_opaque_enum_ptr(cx: @CrateContext) -> TypeRef {
1061-
return T_ptr(T_opaque_enum(cx));
1062-
}
1063-
10641049
pub fn T_captured_tydescs(cx: @CrateContext, n: uint) -> TypeRef {
10651050
return T_struct(vec::from_elem::<TypeRef>(n, T_ptr(cx.tydesc_type)));
10661051
}
@@ -1467,18 +1452,6 @@ pub fn dummy_substs(+tps: ~[ty::t]) -> ty::substs {
14671452
}
14681453
}
14691454

1470-
pub fn struct_field(index: uint) -> [uint * 3] {
1471-
//! The GEPi sequence to access a field of a record/struct.
1472-
1473-
[0, 0, index]
1474-
}
1475-
1476-
pub fn struct_dtor() -> [uint * 2] {
1477-
//! The GEPi sequence to access the dtor of a struct.
1478-
1479-
[0, 1]
1480-
}
1481-
14821455
// Casts a Rust bool value to an i1.
14831456
pub fn bool_to_i1(bcx: block, llval: ValueRef) -> ValueRef {
14841457
build::ICmp(bcx, lib::llvm::IntNE, llval, C_bool(false))

0 commit comments

Comments
 (0)