about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-09-14 09:19:31 -0700
committerBrian Anderson <banderson@mozilla.com>2011-09-14 09:19:31 -0700
commit31d4fe37f688f3960bb79f3cecbf233d15c4ba29 (patch)
tree002883eefe2b2bd0a1c75a348bc30ac59c823f5a /src/comp
parent93de2f0b7498cbc6a304ba3cb80f5a3ea57b8bc7 (diff)
downloadrust-31d4fe37f688f3960bb79f3cecbf233d15c4ba29.tar.gz
rust-31d4fe37f688f3960bb79f3cecbf233d15c4ba29.zip
Revert "Try a little harder to avoid creating new landing pads"
This reverts commit b8e31ac46917edcf5922f0b191c5e6c4505830d2.

Conflicts:

	src/comp/middle/trans.rs
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/trans.rs12
-rw-r--r--src/comp/middle/trans_common.rs9
2 files changed, 10 insertions, 11 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index ba495934387..5f89f17daf2 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -3748,11 +3748,11 @@ fn invoke_(bcx: @block_ctxt, llfn: ValueRef,
 
 fn get_landing_pad(bcx: @block_ctxt) -> BasicBlockRef {
     let scope_bcx = find_scope_for_lpad(bcx);
-    if scope_bcx.need_new_lpad {
+    if scope_bcx.cleanups_dirty {
         let unwind_bcx = new_sub_block_ctxt(bcx, "unwind");
         let lpadbb = trans_landing_pad(unwind_bcx);
         scope_bcx.lpad = some(lpadbb);
-        scope_bcx.need_new_lpad = false;
+        scope_bcx.cleanups_dirty = false;
     }
     assert option::is_some(scope_bcx.lpad);
     ret option::get(scope_bcx.lpad);
@@ -4566,7 +4566,7 @@ fn new_block_ctxt(cx: @fn_ctxt, parent: block_parent, kind: block_kind,
           parent: parent,
           kind: kind,
           mutable cleanups: [],
-          mutable need_new_lpad: true,
+          mutable cleanups_dirty: true,
           mutable lpad: option::none,
           sp: cx.sp,
           fcx: cx};
@@ -4602,7 +4602,7 @@ fn new_raw_block_ctxt(fcx: @fn_ctxt, llbb: BasicBlockRef) -> @block_ctxt {
           parent: parent_none,
           kind: NON_SCOPE_BLOCK,
           mutable cleanups: [],
-          mutable need_new_lpad: true,
+          mutable cleanups_dirty: true,
           mutable lpad: option::none,
           sp: fcx.sp,
           fcx: fcx};
@@ -4670,7 +4670,7 @@ fn llstaticallocas_block_ctxt(fcx: @fn_ctxt) -> @block_ctxt {
           parent: parent_none,
           kind: SCOPE_BLOCK,
           mutable cleanups: [],
-          mutable need_new_lpad: true,
+          mutable cleanups_dirty: true,
           mutable lpad: option::none,
           sp: fcx.sp,
           fcx: fcx};
@@ -4682,7 +4682,7 @@ fn llderivedtydescs_block_ctxt(fcx: @fn_ctxt) -> @block_ctxt {
           parent: parent_none,
           kind: SCOPE_BLOCK,
           mutable cleanups: [],
-          mutable need_new_lpad: true,
+          mutable cleanups_dirty: true,
           mutable lpad: option::none,
           sp: fcx.sp,
           fcx: fcx};
diff --git a/src/comp/middle/trans_common.rs b/src/comp/middle/trans_common.rs
index eb4192c4e99..9e9d55f19ce 100644
--- a/src/comp/middle/trans_common.rs
+++ b/src/comp/middle/trans_common.rs
@@ -273,6 +273,7 @@ tag cleanup {
 fn add_clean(cx: @block_ctxt, val: ValueRef, ty: ty::t) {
     let scope_cx = find_scope_cx(cx);
     scope_cx.cleanups += [clean(bind drop_ty(_, val, ty))];
+    scope_cx.cleanups_dirty = true;
 }
 fn add_clean_temp(cx: @block_ctxt, val: ValueRef, ty: ty::t) {
     fn spill_and_drop(cx: @block_ctxt, val: ValueRef, ty: ty::t) ->
@@ -286,9 +287,7 @@ fn add_clean_temp(cx: @block_ctxt, val: ValueRef, ty: ty::t) {
     let scope_cx = find_scope_cx(cx);
     scope_cx.cleanups +=
         [clean_temp(val, bind spill_and_drop(_, val, ty))];
-    if trans::type_is_immediate(bcx_ccx(cx), ty) {
-        scope_cx.need_new_lpad = true;
-    }
+    scope_cx.cleanups_dirty = true;
 }
 
 // Note that this only works for temporaries. We should, at some point, move
@@ -322,7 +321,7 @@ fn revoke_clean(cx: @block_ctxt, val: ValueRef, t: ty::t) -> @block_ctxt {
         std::vec::slice(sc_cx.cleanups, 0u, found as uint) +
             std::vec::slice(sc_cx.cleanups, (found as uint) + 1u,
                             std::vec::len(sc_cx.cleanups));
-    sc_cx.need_new_lpad = true;
+    sc_cx.cleanups_dirty = true;
     ret cx;
 }
 
@@ -394,7 +393,7 @@ type block_ctxt =
      parent: block_parent,
      kind: block_kind,
      mutable cleanups: [cleanup],
-     mutable need_new_lpad: bool,
+     mutable cleanups_dirty: bool,
      mutable lpad: option::t<BasicBlockRef>,
      sp: span,
      fcx: @fn_ctxt};