librustc: De-@mut ScopeInfo::landing_pad

This commit is contained in:
Patrick Walton 2013-12-21 15:58:54 -08:00
parent 7acaa73377
commit 8728b09e78
2 changed files with 8 additions and 8 deletions

View File

@ -997,7 +997,7 @@ pub fn need_invoke(bcx: @Block) -> bool {
pub fn have_cached_lpad(bcx: @Block) -> bool {
let mut res = false;
in_lpad_scope_cx(bcx, |inf| {
match inf.landing_pad {
match inf.landing_pad.get() {
Some(_) => res = true,
None => res = false
}
@ -1032,11 +1032,11 @@ pub fn get_landing_pad(bcx: @Block) -> BasicBlockRef {
let mut pad_bcx = bcx; // Guaranteed to be set below
in_lpad_scope_cx(bcx, |inf| {
// If there is a valid landing pad still around, use it
match inf.landing_pad {
match inf.landing_pad.get() {
Some(target) => cached = Some(target),
None => {
pad_bcx = lpad_block(bcx, "unwind");
inf.landing_pad = Some(pad_bcx.llbb);
inf.landing_pad.set(Some(pad_bcx.llbb));
}
}
});
@ -1224,7 +1224,7 @@ pub fn simple_block_scope(parent: Option<@mut ScopeInfo>,
loop_label: None,
cleanups: RefCell::new(~[]),
cleanup_paths: RefCell::new(~[]),
landing_pad: None,
landing_pad: Cell::new(None),
node_info: node_info,
}
}
@ -1254,7 +1254,7 @@ pub fn loop_scope_block(bcx: @Block,
loop_label: loop_label,
cleanups: RefCell::new(~[]),
cleanup_paths: RefCell::new(~[]),
landing_pad: None,
landing_pad: Cell::new(None),
node_info: opt_node_info,
}), bcx.is_lpad, n, opt_node_info);
}

View File

@ -431,7 +431,7 @@ pub struct cleanup_path {
}
pub fn shrink_scope_clean(scope_info: &mut ScopeInfo, size: uint) {
scope_info.landing_pad = None;
scope_info.landing_pad.set(None);
let new_cleanup_paths = {
let cleanup_paths = scope_info.cleanup_paths.borrow();
cleanup_paths.get()
@ -444,7 +444,7 @@ pub fn shrink_scope_clean(scope_info: &mut ScopeInfo, size: uint) {
}
pub fn grow_scope_clean(scope_info: &mut ScopeInfo) {
scope_info.landing_pad = None;
scope_info.landing_pad.set(None);
}
pub fn cleanup_type(cx: ty::ctxt, ty: ty::t) -> cleantype {
@ -634,7 +634,7 @@ pub struct ScopeInfo {
// cleared when the set of cleanups changes.
cleanup_paths: RefCell<~[cleanup_path]>,
// Unwinding landing pad. Also cleared when cleanups change.
landing_pad: Option<BasicBlockRef>,
landing_pad: Cell<Option<BasicBlockRef>>,
// info about the AST node this scope originated from, if any
node_info: Option<NodeInfo>,
}