Skip to content

Commit 05e57db

Browse files
committed
librustc: De-@mut FunctionContext::personality
1 parent cd5168b commit 05e57db

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/librustc/middle/trans/base.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,11 +1056,11 @@ pub fn get_landing_pad(bcx: @Block) -> BasicBlockRef {
10561056

10571057
// We store the retval in a function-central alloca, so that calls to
10581058
// Resume can find it.
1059-
match bcx.fcx.personality {
1059+
match bcx.fcx.personality.get() {
10601060
Some(addr) => Store(pad_bcx, llretval, addr),
10611061
None => {
10621062
let addr = alloca(pad_bcx, val_ty(llretval), "");
1063-
bcx.fcx.personality = Some(addr);
1063+
bcx.fcx.personality.set(Some(addr));
10641064
Store(pad_bcx, llretval, addr);
10651065
}
10661066
}
@@ -1378,7 +1378,7 @@ pub fn cleanup_and_leave(bcx: @Block,
13781378
match leave {
13791379
Some(target) => Br(bcx, target),
13801380
None => {
1381-
let ll_load = Load(bcx, bcx.fcx.personality.unwrap());
1381+
let ll_load = Load(bcx, bcx.fcx.personality.get().unwrap());
13821382
Resume(bcx, ll_load);
13831383
}
13841384
}
@@ -1690,7 +1690,7 @@ pub fn new_fn_ctxt_w_id(ccx: @CrateContext,
16901690
alloca_insert_pt: Cell::new(None),
16911691
llreturn: Cell::new(None),
16921692
llself: Cell::new(None),
1693-
personality: None,
1693+
personality: Cell::new(None),
16941694
caller_expects_out_pointer: uses_outptr,
16951695
llargs: RefCell::new(HashMap::new()),
16961696
lllocals: RefCell::new(HashMap::new()),

src/librustc/middle/trans/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ pub struct FunctionContext {
232232
llself: Cell<Option<ValSelfData>>,
233233
// The a value alloca'd for calls to upcalls.rust_personality. Used when
234234
// outputting the resume instruction.
235-
personality: Option<ValueRef>,
235+
personality: Cell<Option<ValueRef>>,
236236

237237
// True if the caller expects this fn to use the out pointer to
238238
// return. Either way, your code should write into llretptr, but if

0 commit comments

Comments
 (0)