Skip to content

Commit 8105da8

Browse files
committed
GC the now-unused old layout helpers
1 parent b6bcf1a commit 8105da8

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
@@ -239,25 +239,6 @@ pub fn bump_ptr(bcx: block, t: ty::t, base: ValueRef, sz: ValueRef) ->
239239
PointerCast(bcx, bumped, typ)
240240
}
241241

242-
// Replacement for the LLVM 'GEP' instruction when field indexing into a enum.
243-
// @llblobptr is the data part of a enum value; its actual type
244-
// is meaningless, as it will be cast away.
245-
pub fn GEP_enum(bcx: block, llblobptr: ValueRef, enum_id: ast::def_id,
246-
variant_id: ast::def_id, ty_substs: &[ty::t],
247-
ix: uint) -> ValueRef {
248-
let _icx = bcx.insn_ctxt("GEP_enum");
249-
let ccx = bcx.ccx();
250-
let variant = ty::enum_variant_with_id(ccx.tcx, enum_id, variant_id);
251-
assert ix < variant.args.len();
252-
253-
let arg_lltys = vec::map(variant.args, |aty| {
254-
type_of(ccx, ty::subst_tps(ccx.tcx, ty_substs, None, *aty))
255-
});
256-
let typed_blobptr = PointerCast(bcx, llblobptr,
257-
T_ptr(T_struct(arg_lltys)));
258-
GEPi(bcx, typed_blobptr, [0u, ix])
259-
}
260-
261242
// Returns a pointer to the body for the box. The box may be an opaque
262243
// box. The result will be casted to the type of body_t, if it is statically
263244
// known.

src/librustc/middle/trans/common.rs

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

1045-
pub fn T_opaque_enum(cx: @CrateContext) -> TypeRef {
1046-
let s = @"opaque_enum";
1047-
match name_has_type(cx.tn, s) {
1048-
Some(t) => return t,
1049-
_ => ()
1050-
}
1051-
let t = T_struct(~[T_enum_discrim(cx), T_i8()]);
1052-
associate_type(cx.tn, s, t);
1053-
return t;
1054-
}
1055-
1056-
pub fn T_opaque_enum_ptr(cx: @CrateContext) -> TypeRef {
1057-
return T_ptr(T_opaque_enum(cx));
1058-
}
1059-
10601045
pub fn T_captured_tydescs(cx: @CrateContext, n: uint) -> TypeRef {
10611046
return T_struct(vec::from_elem::<TypeRef>(n, T_ptr(cx.tydesc_type)));
10621047
}
@@ -1468,18 +1453,6 @@ pub fn dummy_substs(+tps: ~[ty::t]) -> ty::substs {
14681453
}
14691454
}
14701455

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

0 commit comments

Comments
 (0)