output_type: ty::t,
param_substs: &'a param_substs,
sp: Option<Span>,
- block_arena: &'a TypedArena<Block<'a>>)
+ block_arena: &'a TypedArena<Block<'a>>,
+ handle_items: HandleItemsFlag)
-> FunctionContext<'a> {
param_substs.validate();
block_arena: block_arena,
ccx: ccx,
debug_context: debug_context,
- scopes: RefCell::new(Vec::new())
+ scopes: RefCell::new(Vec::new()),
+ handle_items: handle_items,
};
if has_env {
abi: Abi,
has_env: bool,
is_unboxed_closure: IsUnboxedClosureFlag,
- maybe_load_env: <'a> |&'a Block<'a>| -> &'a Block<'a>) {
+ maybe_load_env: <'a> |&'a Block<'a>| -> &'a Block<'a>,
+ handle_items: HandleItemsFlag) {
ccx.stats.n_closures.set(ccx.stats.n_closures.get() + 1);
let _icx = push_ctxt("trans_closure");
output_type,
param_substs,
Some(body.span),
- &arena);
+ &arena,
+ handle_items);
let mut bcx = init_function(&fcx, false, output_type);
// cleanup scope for the incoming arguments
llfndecl: ValueRef,
param_substs: ¶m_substs,
id: ast::NodeId,
- attrs: &[ast::Attribute]) {
+ attrs: &[ast::Attribute],
+ handle_items: HandleItemsFlag) {
let _s = StatRecorder::new(ccx, ccx.tcx.map.path_to_string(id).to_string());
debug!("trans_fn(param_substs={})", param_substs.repr(ccx.tcx()));
let _icx = push_ctxt("trans_fn");
abi,
false,
NotUnboxedClosure,
- |bcx| bcx);
+ |bcx| bcx,
+ handle_items);
}
pub fn trans_enum_variant(ccx: &CrateContext,
let arena = TypedArena::new();
let fcx = new_fn_ctxt(ccx, llfndecl, ctor_id, false, result_ty,
- param_substs, None, &arena);
+ param_substs, None, &arena, TranslateItems);
let bcx = init_function(&fcx, false, result_ty);
let arg_tys = ty::ty_fn_args(ctor_ty);
llfn,
¶m_substs::empty(),
item.id,
- item.attrs.as_slice());
+ item.attrs.as_slice(),
+ TranslateItems);
} else {
// Be sure to travel more than just one layer deep to catch nested
// items in blocks and such.