librustc: De-@mut FunctionContext::entry_bcx
This commit is contained in:
parent
05e57db348
commit
7437a56f3b
6 changed files with 11 additions and 11 deletions
|
|
@ -1641,7 +1641,7 @@ pub fn make_return_pointer(fcx: @mut FunctionContext, output_type: ty::t) -> Val
|
|||
llvm::LLVMGetParam(fcx.llfn, 0)
|
||||
} else {
|
||||
let lloutputtype = type_of::type_of(fcx.ccx, output_type);
|
||||
let bcx = fcx.entry_bcx.unwrap();
|
||||
let bcx = fcx.entry_bcx.get().unwrap();
|
||||
Alloca(bcx, lloutputtype, "__make_return_pointer")
|
||||
}
|
||||
}
|
||||
|
|
@ -1686,7 +1686,7 @@ pub fn new_fn_ctxt_w_id(ccx: @CrateContext,
|
|||
Cell::new(llvm::LLVMGetUndef(Type::i8p().to_ref()))
|
||||
},
|
||||
llretptr: Cell::new(None),
|
||||
entry_bcx: None,
|
||||
entry_bcx: RefCell::new(None),
|
||||
alloca_insert_pt: Cell::new(None),
|
||||
llreturn: Cell::new(None),
|
||||
llself: Cell::new(None),
|
||||
|
|
@ -1710,7 +1710,7 @@ pub fn new_fn_ctxt_w_id(ccx: @CrateContext,
|
|||
let entry_bcx = top_scope_block(fcx, opt_node_info);
|
||||
Load(entry_bcx, C_null(Type::i8p()));
|
||||
|
||||
fcx.entry_bcx = Some(entry_bcx);
|
||||
fcx.entry_bcx.set(Some(entry_bcx));
|
||||
fcx.alloca_insert_pt.set(Some(
|
||||
llvm::LLVMGetFirstInstruction(entry_bcx.llbb)));
|
||||
}
|
||||
|
|
@ -1921,7 +1921,7 @@ pub fn trans_closure(ccx: @CrateContext,
|
|||
|
||||
// Create the first basic block in the function and keep a handle on it to
|
||||
// pass to finish_fn later.
|
||||
let bcx_top = fcx.entry_bcx.unwrap();
|
||||
let bcx_top = fcx.entry_bcx.get().unwrap();
|
||||
let mut bcx = bcx_top;
|
||||
let block_ty = node_id_type(bcx, body.id);
|
||||
|
||||
|
|
@ -2136,7 +2136,7 @@ pub fn trans_enum_variant_or_tuple_like_struct<A:IdAndTy>(
|
|||
|
||||
let raw_llargs = create_llargs_for_fn_args(fcx, no_self, fn_args);
|
||||
|
||||
let bcx = fcx.entry_bcx.unwrap();
|
||||
let bcx = fcx.entry_bcx.get().unwrap();
|
||||
|
||||
insert_synthetic_type_entries(bcx, fn_args, arg_tys);
|
||||
let bcx = copy_args_to_allocas(fcx, bcx, fn_args, raw_llargs, arg_tys);
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ pub fn load_environment(fcx: @mut FunctionContext,
|
|||
return;
|
||||
}
|
||||
|
||||
let bcx = fcx.entry_bcx.unwrap();
|
||||
let bcx = fcx.entry_bcx.get().unwrap();
|
||||
|
||||
// Load a pointer to the closure data, skipping over the box header:
|
||||
let llcdata = opaque_box_body(bcx, cdata_ty, fcx.llenv.get());
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ pub struct FunctionContext {
|
|||
// always be Some.
|
||||
llretptr: Cell<Option<ValueRef>>,
|
||||
|
||||
entry_bcx: Option<@Block>,
|
||||
entry_bcx: RefCell<Option<@Block>>,
|
||||
|
||||
// These elements: "hoisted basic blocks" containing
|
||||
// administrative activities that have to happen in only one place in
|
||||
|
|
@ -296,7 +296,7 @@ impl FunctionContext {
|
|||
.unwrap());
|
||||
}
|
||||
// Remove the cycle between fcx and bcx, so memory can be freed
|
||||
self.entry_bcx = None;
|
||||
self.entry_bcx.set(None);
|
||||
}
|
||||
|
||||
pub fn get_llreturn(&mut self) -> BasicBlockRef {
|
||||
|
|
|
|||
|
|
@ -669,7 +669,7 @@ pub fn make_generic_glue_inner(ccx: @CrateContext,
|
|||
// llfn is expected be declared to take a parameter of the appropriate
|
||||
// type, so we don't need to explicitly cast the function parameter.
|
||||
|
||||
let bcx = fcx.entry_bcx.unwrap();
|
||||
let bcx = fcx.entry_bcx.get().unwrap();
|
||||
let rawptr0_arg = fcx.arg_pos(0u);
|
||||
let llrawptr0 = unsafe { llvm::LLVMGetParam(llfn, rawptr0_arg as c_uint) };
|
||||
let bcx = helper(bcx, llrawptr0, t);
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ pub fn trans_intrinsic(ccx: @CrateContext,
|
|||
|
||||
set_always_inline(fcx.llfn);
|
||||
|
||||
let mut bcx = fcx.entry_bcx.unwrap();
|
||||
let mut bcx = fcx.entry_bcx.get().unwrap();
|
||||
let first_real_arg = fcx.arg_pos(0u);
|
||||
|
||||
let nm = ccx.sess.str_of(item.ident);
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ impl Reflector {
|
|||
//
|
||||
llvm::LLVMGetParam(llfdecl, fcx.arg_pos(0u) as c_uint)
|
||||
};
|
||||
let mut bcx = fcx.entry_bcx.unwrap();
|
||||
let mut bcx = fcx.entry_bcx.get().unwrap();
|
||||
let arg = BitCast(bcx, arg, llptrty);
|
||||
let ret = adt::trans_get_discr(bcx, repr, arg, Some(Type::i64()));
|
||||
Store(bcx, ret, fcx.llretptr.get().unwrap());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue