Skip to content

Commit 29997f4

Browse files
committed
---
yaml --- r: 102449 b: refs/heads/auto c: 383e3fd h: refs/heads/master i: 102447: 254ce7c v: v3
1 parent b637a4a commit 29997f4

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 50bee30459974d4ac9b5be085d8b797c6d0e4995
16+
refs/heads/auto: 383e3fd13b99827b5dbb107da7433bd0a70dea80
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc/middle/trans/glue.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -367,17 +367,9 @@ fn make_drop_glue<'a>(bcx: &'a Block<'a>, v0: ValueRef, t: ty::t) -> &'a Block<'
367367
let lluniquevalue = GEPi(bcx, v0, [0, abi::trt_field_box]);
368368
// Only drop the value when it is non-null
369369
with_cond(bcx, IsNotNull(bcx, Load(bcx, lluniquevalue)), |bcx| {
370-
let llvtable = Load(bcx, GEPi(bcx, v0, [0, abi::trt_field_vtable]));
371-
372-
// Cast the vtable to a pointer to a pointer to a tydesc.
373-
let llvtable = PointerCast(bcx, llvtable,
374-
ccx.tydesc_type.ptr_to().ptr_to());
375-
let lltydesc = Load(bcx, llvtable);
376-
call_tydesc_glue_full(bcx,
377-
lluniquevalue,
378-
lltydesc,
379-
abi::tydesc_field_drop_glue,
380-
None);
370+
let lldtor_ptr = Load(bcx, GEPi(bcx, v0, [0, abi::trt_field_vtable]));
371+
let lldtor = Load(bcx, lldtor_ptr);
372+
Call(bcx, lldtor, [PointerCast(bcx, lluniquevalue, Type::i8p())], []);
381373
bcx
382374
})
383375
}

branches/auto/src/librustc/middle/trans/meth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ pub fn make_vtable(ccx: &CrateContext,
498498
unsafe {
499499
let _icx = push_ctxt("meth::make_vtable");
500500

501-
let mut components = ~[ tydesc.tydesc ];
501+
let mut components = ~[tydesc.drop_glue.get().unwrap()];
502502
for &ptr in ptrs.iter() {
503503
components.push(ptr)
504504
}

branches/auto/src/librustc/middle/trans/type_.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl Type {
180180
}
181181

182182
pub fn vtable() -> Type {
183-
Type::array(&Type::i8().ptr_to(), 1)
183+
Type::array(&Type::i8p().ptr_to(), 1)
184184
}
185185

186186
pub fn generic_glue_fn(cx: &CrateContext) -> Type {
@@ -246,13 +246,13 @@ impl Type {
246246
}
247247

248248
pub fn opaque_trait(ctx: &CrateContext, store: ty::TraitStore) -> Type {
249-
let tydesc_ptr = ctx.tydesc_type.ptr_to();
249+
let vtable = Type::glue_fn(Type::i8p()).ptr_to().ptr_to();
250250
let box_ty = match store {
251251
ty::BoxTraitStore => Type::at_box(ctx, Type::i8()),
252252
ty::UniqTraitStore => Type::i8(),
253253
ty::RegionTraitStore(..) => Type::i8()
254254
};
255-
Type::struct_([tydesc_ptr, box_ty.ptr_to()], false)
255+
Type::struct_([vtable, box_ty.ptr_to()], false)
256256
}
257257

258258
pub fn kind(&self) -> TypeKind {

0 commit comments

Comments
 (0)