Skip to content

Commit 740af79

Browse files
committed
---
yaml --- r: 4423 b: refs/heads/master c: a26c027 h: refs/heads/master i: 4421: 2c0d445 4419: 6e434a6 4415: 3be859e v: v3
1 parent da8de9c commit 740af79

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 3d5a777fe19ab210aedf473678687a98023ff586
2+
refs/heads/master: a26c027731fbee8a0a7c6e4a93a90f1ac73b4fd9

trunk/src/comp/middle/trans.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2349,12 +2349,7 @@ fn drop_slot(cx: &@block_ctxt, slot: ValueRef, t: &ty::t) -> result {
23492349
let re = drop_ty(cx, llptr, t);
23502350
let llty = val_ty(slot);
23512351
let llelemty = lib::llvm::llvm::LLVMGetElementType(llty);
2352-
if ty::type_is_structural(bcx_tcx(cx), t) {
2353-
call_bzero(cx, slot, C_uint(llsize_of_real(bcx_ccx(cx), llelemty)),
2354-
C_uint(llalign_of_real(bcx_ccx(cx), llelemty)));
2355-
} else {
2356-
cx.build.Store(C_null(llelemty), slot);
2357-
}
2352+
call_bzero(cx, slot, llsize_of(llelemty), C_uint(1u));
23582353
ret re;
23592354
}
23602355

@@ -5860,13 +5855,7 @@ fn zero_alloca(cx: &@block_ctxt, llptr: ValueRef, t: ty::t) -> result {
58605855
bcx = call_bzero(llalign.bcx, llptr, llsz.val, llalign.val).bcx;
58615856
} else {
58625857
let llty = type_of(bcx_ccx(bcx), cx.sp, t);
5863-
if ty::type_is_structural(bcx_tcx(cx), t) {
5864-
bcx = call_bzero(cx, llptr,
5865-
C_uint(llsize_of_real(bcx_ccx(cx), llty)),
5866-
C_uint(llalign_of_real(bcx_ccx(cx), llty))).bcx;
5867-
} else {
5868-
bcx.build.Store(C_null(llty), llptr);
5869-
}
5858+
bcx = call_bzero(cx, llptr, llsize_of(llty), C_uint(1u)).bcx;
58705859
}
58715860
ret rslt(bcx, llptr);
58725861
}

0 commit comments

Comments
 (0)