Skip to content

Commit d880387

Browse files
committed
---
yaml --- r: 143101 b: refs/heads/try2 c: 3cccdbd h: refs/heads/master i: 143099: 5d89d1c v: v3
1 parent 8a12630 commit d880387

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: d4051178976aa0527ede20e6c053f72b3d4dc20c
8+
refs/heads/try2: 3cccdbd9ccccd8768caea7cdf03e88a4f26ea301
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -546,18 +546,23 @@ pub fn decr_refcnt_maybe_free(bcx: block, box_ptr: ValueRef,
546546
let _icx = push_ctxt("decr_refcnt_maybe_free");
547547
let ccx = bcx.ccx();
548548

549-
do with_cond(bcx, IsNotNull(bcx, box_ptr)) |bcx| {
550-
let rc_ptr = GEPi(bcx, box_ptr, [0u, abi::box_field_refcnt]);
551-
let rc = Sub(bcx, Load(bcx, rc_ptr), C_int(ccx, 1));
552-
Store(bcx, rc, rc_ptr);
553-
let zero_test = ICmp(bcx, lib::llvm::IntEQ, C_int(ccx, 0), rc);
554-
do with_cond(bcx, zero_test) |bcx| {
555-
match box_ptr_ptr {
556-
Some(p) => free_ty(bcx, p, t),
557-
None => free_ty_immediate(bcx, box_ptr, t)
558-
}
559-
}
560-
}
549+
let decr_bcx = sub_block(bcx, "decr");
550+
let free_bcx = sub_block(decr_bcx, "free");
551+
let next_bcx = sub_block(bcx, "next");
552+
CondBr(bcx, IsNotNull(bcx, box_ptr), decr_bcx.llbb, next_bcx.llbb);
553+
554+
let rc_ptr = GEPi(decr_bcx, box_ptr, [0u, abi::box_field_refcnt]);
555+
let rc = Sub(decr_bcx, Load(decr_bcx, rc_ptr), C_int(ccx, 1));
556+
Store(decr_bcx, rc, rc_ptr);
557+
CondBr(decr_bcx, IsNull(decr_bcx, rc), free_bcx.llbb, next_bcx.llbb);
558+
559+
let free_bcx = match box_ptr_ptr {
560+
Some(p) => free_ty(free_bcx, p, t),
561+
None => free_ty_immediate(free_bcx, box_ptr, t)
562+
};
563+
Br(free_bcx, next_bcx.llbb);
564+
565+
next_bcx
561566
}
562567

563568

0 commit comments

Comments
 (0)