Skip to content

Commit 7033dfc

Browse files
committed
auto merge of #7069 : dotdash/rust/cast_combine, r=graydon
Shaves off a percent or so from the LLVM passes for librustc.
2 parents 8761b1f + f526434 commit 7033dfc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/librustc/middle/trans/base.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,8 @@ pub fn opaque_box_body(bcx: block,
269269
boxptr: ValueRef) -> ValueRef {
270270
let _icx = bcx.insn_ctxt("opaque_box_body");
271271
let ccx = bcx.ccx();
272-
let boxptr = PointerCast(bcx, boxptr, T_ptr(T_box_header(ccx)));
273-
let bodyptr = GEPi(bcx, boxptr, [1u]);
274-
PointerCast(bcx, bodyptr, T_ptr(type_of(ccx, body_t)))
272+
let boxptr = PointerCast(bcx, boxptr, T_ptr(T_box(ccx, type_of(ccx, body_t))));
273+
GEPi(bcx, boxptr, [0u, abi::box_field_body])
275274
}
276275

277276
// malloc_raw_dyn: allocates a box to contain a given type, but with a

0 commit comments

Comments
 (0)