Drop the impl_id field from fn_ctxt.
This commit is contained in:
parent
5943118728
commit
c05165bf93
src/librustc/middle/trans
@ -1545,17 +1545,15 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext,
|
||||
llfndecl: ValueRef,
|
||||
id: ast::node_id,
|
||||
output_type: ty::t,
|
||||
impl_id: Option<ast::def_id>,
|
||||
param_substs: Option<@param_substs>,
|
||||
sp: Option<span>)
|
||||
-> fn_ctxt {
|
||||
for param_substs.iter().advance |p| { p.validate(); }
|
||||
|
||||
debug!("new_fn_ctxt_w_id(path=%s, id=%?, impl_id=%?, \
|
||||
debug!("new_fn_ctxt_w_id(path=%s, id=%?, \
|
||||
param_substs=%s)",
|
||||
path_str(ccx.sess, path),
|
||||
id,
|
||||
impl_id,
|
||||
param_substs.repr(ccx.tcx));
|
||||
|
||||
let llbbs = mk_standard_basic_blocks(llfndecl);
|
||||
@ -1584,7 +1582,6 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext,
|
||||
lllocals: @mut HashMap::new(),
|
||||
llupvars: @mut HashMap::new(),
|
||||
id: id,
|
||||
impl_id: impl_id,
|
||||
param_substs: param_substs,
|
||||
span: sp,
|
||||
path: path,
|
||||
@ -1605,7 +1602,7 @@ pub fn new_fn_ctxt(ccx: @mut CrateContext,
|
||||
output_type: ty::t,
|
||||
sp: Option<span>)
|
||||
-> fn_ctxt {
|
||||
new_fn_ctxt_w_id(ccx, path, llfndecl, -1, output_type, None, None, sp)
|
||||
new_fn_ctxt_w_id(ccx, path, llfndecl, -1, output_type, None, sp)
|
||||
}
|
||||
|
||||
// NB: must keep 4 fns in sync:
|
||||
@ -1774,7 +1771,6 @@ pub fn trans_closure(ccx: @mut CrateContext,
|
||||
self_arg: self_arg,
|
||||
param_substs: Option<@param_substs>,
|
||||
id: ast::node_id,
|
||||
impl_id: Option<ast::def_id>,
|
||||
attributes: &[ast::attribute],
|
||||
output_type: ty::t,
|
||||
maybe_load_env: &fn(fn_ctxt),
|
||||
@ -1792,7 +1788,6 @@ pub fn trans_closure(ccx: @mut CrateContext,
|
||||
llfndecl,
|
||||
id,
|
||||
output_type,
|
||||
impl_id,
|
||||
param_substs,
|
||||
Some(body.span));
|
||||
let raw_llargs = create_llargs_for_fn_args(fcx, self_arg, decl.inputs);
|
||||
@ -1851,7 +1846,6 @@ pub fn trans_fn(ccx: @mut CrateContext,
|
||||
self_arg: self_arg,
|
||||
param_substs: Option<@param_substs>,
|
||||
id: ast::node_id,
|
||||
impl_id: Option<ast::def_id>,
|
||||
attrs: &[ast::attribute]) {
|
||||
let do_time = ccx.sess.trans_stats();
|
||||
let start = if do_time { time::get_time() }
|
||||
@ -1871,7 +1865,6 @@ pub fn trans_fn(ccx: @mut CrateContext,
|
||||
self_arg,
|
||||
param_substs,
|
||||
id,
|
||||
impl_id,
|
||||
attrs,
|
||||
output_type,
|
||||
|fcx| {
|
||||
@ -1921,7 +1914,6 @@ pub fn trans_enum_variant(ccx: @mut CrateContext,
|
||||
llfndecl,
|
||||
variant.node.id,
|
||||
enum_ty,
|
||||
None,
|
||||
param_substs,
|
||||
None);
|
||||
|
||||
@ -2001,7 +1993,6 @@ pub fn trans_tuple_struct(ccx: @mut CrateContext,
|
||||
llfndecl,
|
||||
ctor_id,
|
||||
tup_ty,
|
||||
None,
|
||||
param_substs,
|
||||
None);
|
||||
|
||||
@ -2081,7 +2072,6 @@ pub fn trans_item(ccx: @mut CrateContext, item: &ast::item) {
|
||||
no_self,
|
||||
None,
|
||||
item.id,
|
||||
None,
|
||||
item.attrs);
|
||||
} else {
|
||||
for body.node.stmts.iter().advance |stmt| {
|
||||
|
@ -444,7 +444,6 @@ pub fn trans_expr_fn(bcx: block,
|
||||
no_self,
|
||||
/*bad*/ copy bcx.fcx.param_substs,
|
||||
user_id,
|
||||
None,
|
||||
[],
|
||||
real_return_type,
|
||||
|fcx| load_environment(fcx, cdata_ty, cap_vars,
|
||||
|
@ -222,9 +222,6 @@ pub struct fn_ctxt_ {
|
||||
// a user-defined function.
|
||||
id: ast::node_id,
|
||||
|
||||
// The def_id of the impl we're inside, or None if we aren't inside one.
|
||||
impl_id: Option<ast::def_id>,
|
||||
|
||||
// If this function is being monomorphized, this contains the type
|
||||
// substitutions used.
|
||||
param_substs: Option<@param_substs>,
|
||||
|
@ -555,7 +555,6 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
|
||||
decl,
|
||||
item.id,
|
||||
output_type,
|
||||
None,
|
||||
Some(substs),
|
||||
Some(item.span));
|
||||
|
||||
@ -1183,7 +1182,6 @@ pub fn trans_foreign_fn(ccx: @mut CrateContext,
|
||||
no_self,
|
||||
None,
|
||||
id,
|
||||
None,
|
||||
[]);
|
||||
return llfndecl;
|
||||
}
|
||||
|
@ -127,7 +127,6 @@ pub fn maybe_instantiate_inline(ccx: @mut CrateContext, fn_id: ast::def_id,
|
||||
self_kind,
|
||||
None,
|
||||
mth.id,
|
||||
Some(impl_did),
|
||||
[]);
|
||||
}
|
||||
local_def(mth.id)
|
||||
|
@ -68,8 +68,7 @@ pub fn trans_impl(ccx: @mut CrateContext,
|
||||
path,
|
||||
*method,
|
||||
None,
|
||||
llfn,
|
||||
ast_util::local_def(id));
|
||||
llfn);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -90,8 +89,7 @@ pub fn trans_method(ccx: @mut CrateContext,
|
||||
path: path,
|
||||
method: &ast::method,
|
||||
param_substs: Option<@param_substs>,
|
||||
llfn: ValueRef,
|
||||
impl_id: ast::def_id) {
|
||||
llfn: ValueRef) {
|
||||
// figure out how self is being passed
|
||||
let self_arg = match method.explicit_self.node {
|
||||
ast::sty_static => {
|
||||
@ -127,7 +125,6 @@ pub fn trans_method(ccx: @mut CrateContext,
|
||||
self_arg,
|
||||
param_substs,
|
||||
method.id,
|
||||
Some(impl_id),
|
||||
[]);
|
||||
}
|
||||
|
||||
|
@ -196,7 +196,6 @@ pub fn monomorphic_fn(ccx: @mut CrateContext,
|
||||
no_self,
|
||||
psubsts,
|
||||
fn_id.node,
|
||||
None,
|
||||
[]);
|
||||
d
|
||||
}
|
||||
@ -224,27 +223,17 @@ pub fn monomorphic_fn(ccx: @mut CrateContext,
|
||||
}
|
||||
d
|
||||
}
|
||||
ast_map::node_method(mth, supplied_impl_did, _) => {
|
||||
ast_map::node_method(mth, _, _) => {
|
||||
// XXX: What should the self type be here?
|
||||
let d = mk_lldecl();
|
||||
set_inline_hint_if_appr(/*bad*/copy mth.attrs, d);
|
||||
|
||||
// Override the impl def ID if necessary.
|
||||
let impl_did;
|
||||
match impl_did_opt {
|
||||
None => impl_did = supplied_impl_did,
|
||||
Some(override_impl_did) => impl_did = override_impl_did
|
||||
}
|
||||
|
||||
meth::trans_method(ccx, pt, mth, psubsts, d, impl_did);
|
||||
meth::trans_method(ccx, pt, mth, psubsts, d);
|
||||
d
|
||||
}
|
||||
ast_map::node_trait_method(@ast::provided(mth), _, pt) => {
|
||||
let d = mk_lldecl();
|
||||
set_inline_hint_if_appr(/*bad*/copy mth.attrs, d);
|
||||
debug!("monomorphic_fn impl_did_opt is %?", impl_did_opt);
|
||||
meth::trans_method(ccx, /*bad*/copy *pt, mth, psubsts, d,
|
||||
impl_did_opt.get());
|
||||
meth::trans_method(ccx, /*bad*/copy *pt, mth, psubsts, d);
|
||||
d
|
||||
}
|
||||
ast_map::node_struct_ctor(struct_def, _, _) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user