File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
src/librustc/middle/trans Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ use util::sha2::Sha256;
69
69
use middle:: trans:: type_:: Type ;
70
70
71
71
use std:: c_str:: ToCStr ;
72
- use std:: cell:: RefCell ;
72
+ use std:: cell:: { Cell , RefCell } ;
73
73
use std:: hashmap:: HashMap ;
74
74
use std:: libc:: c_uint;
75
75
use std:: vec;
@@ -1683,7 +1683,7 @@ pub fn new_fn_ctxt_w_id(ccx: @CrateContext,
1683
1683
let fcx = @mut FunctionContext {
1684
1684
llfn : llfndecl,
1685
1685
llenv : unsafe {
1686
- llvm:: LLVMGetUndef ( Type :: i8p ( ) . to_ref ( ) )
1686
+ Cell :: new ( llvm:: LLVMGetUndef ( Type :: i8p ( ) . to_ref ( ) ) )
1687
1687
} ,
1688
1688
llretptr : None ,
1689
1689
entry_bcx : None ,
@@ -1702,9 +1702,9 @@ pub fn new_fn_ctxt_w_id(ccx: @CrateContext,
1702
1702
ccx : ccx,
1703
1703
debug_context : debug_context,
1704
1704
} ;
1705
- fcx. llenv = unsafe {
1705
+ fcx. llenv . set ( unsafe {
1706
1706
llvm:: LLVMGetParam ( llfndecl, fcx. env_arg_pos ( ) as c_uint )
1707
- } ;
1707
+ } ) ;
1708
1708
1709
1709
unsafe {
1710
1710
let entry_bcx = top_scope_block ( fcx, opt_node_info) ;
@@ -1759,7 +1759,7 @@ pub fn create_llargs_for_fn_args(cx: @mut FunctionContext,
1759
1759
match self_arg {
1760
1760
impl_self( tt, self_mode) => {
1761
1761
cx. llself = Some ( ValSelfData {
1762
- v : cx. llenv ,
1762
+ v : cx. llenv . get ( ) ,
1763
1763
t : tt,
1764
1764
is_copy : self_mode == ty:: ByCopy
1765
1765
} ) ;
Original file line number Diff line number Diff line change @@ -307,7 +307,7 @@ pub fn load_environment(fcx: @mut FunctionContext,
307
307
let bcx = fcx. entry_bcx . unwrap ( ) ;
308
308
309
309
// Load a pointer to the closure data, skipping over the box header:
310
- let llcdata = opaque_box_body ( bcx, cdata_ty, fcx. llenv ) ;
310
+ let llcdata = opaque_box_body ( bcx, cdata_ty, fcx. llenv . get ( ) ) ;
311
311
312
312
// Store the pointer to closure data in an alloca for debug info because that's what the
313
313
// llvm.dbg.declare intrinsic expects
Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ pub struct FunctionContext {
206
206
207
207
// The implicit environment argument that arrives in the function we're
208
208
// creating.
209
- llenv : ValueRef ,
209
+ llenv : Cell < ValueRef > ,
210
210
211
211
// The place to store the return value. If the return type is immediate,
212
212
// this is an alloca in the function. Otherwise, it's the hidden first
You can’t perform that action at this time.
0 commit comments