From 05e57db348aff7535bb7d2cf49f906d4a5366477 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 20 Dec 2013 20:46:40 -0800 Subject: [PATCH] librustc: De-`@mut` `FunctionContext::personality` --- src/librustc/middle/trans/base.rs | 8 ++++---- src/librustc/middle/trans/common.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs index 80044af1ea39..9b10a469e760 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -1056,11 +1056,11 @@ pub fn get_landing_pad(bcx: @Block) -> BasicBlockRef { // We store the retval in a function-central alloca, so that calls to // Resume can find it. - match bcx.fcx.personality { + match bcx.fcx.personality.get() { Some(addr) => Store(pad_bcx, llretval, addr), None => { let addr = alloca(pad_bcx, val_ty(llretval), ""); - bcx.fcx.personality = Some(addr); + bcx.fcx.personality.set(Some(addr)); Store(pad_bcx, llretval, addr); } } @@ -1378,7 +1378,7 @@ pub fn cleanup_and_leave(bcx: @Block, match leave { Some(target) => Br(bcx, target), None => { - let ll_load = Load(bcx, bcx.fcx.personality.unwrap()); + let ll_load = Load(bcx, bcx.fcx.personality.get().unwrap()); Resume(bcx, ll_load); } } @@ -1690,7 +1690,7 @@ pub fn new_fn_ctxt_w_id(ccx: @CrateContext, alloca_insert_pt: Cell::new(None), llreturn: Cell::new(None), llself: Cell::new(None), - personality: None, + personality: Cell::new(None), caller_expects_out_pointer: uses_outptr, llargs: RefCell::new(HashMap::new()), lllocals: RefCell::new(HashMap::new()), diff --git a/src/librustc/middle/trans/common.rs b/src/librustc/middle/trans/common.rs index 17e3286e26bb..a83cde0f4f24 100644 --- a/src/librustc/middle/trans/common.rs +++ b/src/librustc/middle/trans/common.rs @@ -232,7 +232,7 @@ pub struct FunctionContext { llself: Cell>, // The a value alloca'd for calls to upcalls.rust_personality. Used when // outputting the resume instruction. - personality: Option, + personality: Cell>, // True if the caller expects this fn to use the out pointer to // return. Either way, your code should write into llretptr, but if