Skip to content

Commit 5c8bcc4

Browse files
committed
---
yaml --- r: 5261 b: refs/heads/master c: b8e31ac h: refs/heads/master i: 5259: c75fb4c v: v3
1 parent 96770c2 commit 5c8bcc4

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
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: 74c39469beaef51177369c12a08c7ef5273065ca
2+
refs/heads/master: b8e31ac46917edcf5922f0b191c5e6c4505830d2

trunk/src/comp/middle/trans.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3739,11 +3739,11 @@ fn invoke_(bcx: @block_ctxt, llfn: ValueRef,
37393739

37403740
fn get_landing_pad(bcx: @block_ctxt) -> BasicBlockRef {
37413741
let scope_bcx = find_scope_cx(bcx);
3742-
if scope_bcx.cleanups_dirty {
3742+
if scope_bcx.need_new_lpad {
37433743
let unwind_bcx = new_sub_block_ctxt(bcx, "unwind");
37443744
let lpadbb = trans_landing_pad(unwind_bcx);
37453745
scope_bcx.lpad = some(lpadbb);
3746-
scope_bcx.cleanups_dirty = false;
3746+
scope_bcx.need_new_lpad = false;
37473747
}
37483748
assert option::is_some(scope_bcx.lpad);
37493749
ret option::get(scope_bcx.lpad);
@@ -4533,7 +4533,7 @@ fn new_block_ctxt(cx: @fn_ctxt, parent: block_parent, kind: block_kind,
45334533
parent: parent,
45344534
kind: kind,
45354535
mutable cleanups: [],
4536-
mutable cleanups_dirty: true,
4536+
mutable need_new_lpad: true,
45374537
mutable lpad: option::none,
45384538
sp: cx.sp,
45394539
fcx: cx};
@@ -4569,7 +4569,7 @@ fn new_raw_block_ctxt(fcx: @fn_ctxt, llbb: BasicBlockRef) -> @block_ctxt {
45694569
parent: parent_none,
45704570
kind: NON_SCOPE_BLOCK,
45714571
mutable cleanups: [],
4572-
mutable cleanups_dirty: true,
4572+
mutable need_new_lpad: true,
45734573
mutable lpad: option::none,
45744574
sp: fcx.sp,
45754575
fcx: fcx};
@@ -4637,7 +4637,7 @@ fn llstaticallocas_block_ctxt(fcx: @fn_ctxt) -> @block_ctxt {
46374637
parent: parent_none,
46384638
kind: SCOPE_BLOCK,
46394639
mutable cleanups: [],
4640-
mutable cleanups_dirty: true,
4640+
mutable need_new_lpad: true,
46414641
mutable lpad: option::none,
46424642
sp: fcx.sp,
46434643
fcx: fcx};
@@ -4649,7 +4649,7 @@ fn llderivedtydescs_block_ctxt(fcx: @fn_ctxt) -> @block_ctxt {
46494649
parent: parent_none,
46504650
kind: SCOPE_BLOCK,
46514651
mutable cleanups: [],
4652-
mutable cleanups_dirty: true,
4652+
mutable need_new_lpad: true,
46534653
mutable lpad: option::none,
46544654
sp: fcx.sp,
46554655
fcx: fcx};

trunk/src/comp/middle/trans_common.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ tag cleanup {
272272
fn add_clean(cx: @block_ctxt, val: ValueRef, ty: ty::t) {
273273
let scope_cx = find_scope_cx(cx);
274274
scope_cx.cleanups += [clean(bind drop_ty(_, val, ty))];
275-
scope_cx.cleanups_dirty = true;
276275
}
277276
fn add_clean_temp(cx: @block_ctxt, val: ValueRef, ty: ty::t) {
278277
fn spill_and_drop(cx: @block_ctxt, val: ValueRef, ty: ty::t) ->
@@ -286,7 +285,9 @@ fn add_clean_temp(cx: @block_ctxt, val: ValueRef, ty: ty::t) {
286285
let scope_cx = find_scope_cx(cx);
287286
scope_cx.cleanups +=
288287
[clean_temp(val, bind spill_and_drop(_, val, ty))];
289-
scope_cx.cleanups_dirty = true;
288+
if trans::type_is_immediate(bcx_ccx(cx), ty) {
289+
scope_cx.need_new_lpad = true;
290+
}
290291
}
291292

292293
// Note that this only works for temporaries. We should, at some point, move
@@ -320,7 +321,7 @@ fn revoke_clean(cx: @block_ctxt, val: ValueRef, t: ty::t) -> @block_ctxt {
320321
std::vec::slice(sc_cx.cleanups, 0u, found as uint) +
321322
std::vec::slice(sc_cx.cleanups, (found as uint) + 1u,
322323
std::vec::len(sc_cx.cleanups));
323-
sc_cx.cleanups_dirty = true;
324+
sc_cx.need_new_lpad = true;
324325
ret cx;
325326
}
326327

@@ -393,7 +394,7 @@ type block_ctxt =
393394
parent: block_parent,
394395
kind: block_kind,
395396
mutable cleanups: [cleanup],
396-
mutable cleanups_dirty: bool,
397+
mutable need_new_lpad: bool,
397398
mutable lpad: option::t<BasicBlockRef>,
398399
sp: span,
399400
fcx: @fn_ctxt};

0 commit comments

Comments
 (0)