Drop a now unnecessary argument from maybe_instantiate_inline.
This commit is contained in:
parent
186f6faf1e
commit
19446418bc
@ -520,7 +520,7 @@ pub fn get_res_dtor(ccx: @mut CrateContext,
|
||||
let _icx = push_ctxt("trans_res_dtor");
|
||||
if !substs.is_empty() {
|
||||
let did = if did.crate != ast::local_crate {
|
||||
inline::maybe_instantiate_inline(ccx, did, true)
|
||||
inline::maybe_instantiate_inline(ccx, did)
|
||||
} else {
|
||||
did
|
||||
};
|
||||
|
@ -361,8 +361,7 @@ pub fn trans_fn_ref_with_vtables(
|
||||
// def_id to the local id of the inlined copy.
|
||||
let def_id = {
|
||||
if def_id.crate != ast::local_crate {
|
||||
let may_translate = opt_impl_did.is_none();
|
||||
inline::maybe_instantiate_inline(ccx, def_id, may_translate)
|
||||
inline::maybe_instantiate_inline(ccx, def_id)
|
||||
} else {
|
||||
def_id
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ pub fn get_const_val(cx: @mut CrateContext, mut def_id: ast::def_id) -> ValueRef
|
||||
let contains_key = cx.const_values.contains_key(&def_id.node);
|
||||
if !ast_util::is_local(def_id) || !contains_key {
|
||||
if !ast_util::is_local(def_id) {
|
||||
def_id = inline::maybe_instantiate_inline(cx, def_id, true);
|
||||
def_id = inline::maybe_instantiate_inline(cx, def_id);
|
||||
}
|
||||
match cx.tcx.items.get_copy(&def_id.node) {
|
||||
ast_map::node_item(@ast::item {
|
||||
|
@ -956,7 +956,7 @@ fn trans_lvalue_unadjusted(bcx: block, expr: @ast::expr) -> DatumBlock {
|
||||
fn get_did(ccx: @mut CrateContext, did: ast::def_id)
|
||||
-> ast::def_id {
|
||||
if did.crate != ast::local_crate {
|
||||
inline::maybe_instantiate_inline(ccx, did, true)
|
||||
inline::maybe_instantiate_inline(ccx, did)
|
||||
} else {
|
||||
did
|
||||
}
|
||||
|
@ -22,11 +22,7 @@ use syntax::ast;
|
||||
use syntax::ast_map::path_name;
|
||||
use syntax::ast_util::local_def;
|
||||
|
||||
// `translate` will be true if this function is allowed to translate the
|
||||
// item and false otherwise. Currently, this parameter is set to false when
|
||||
// translating default methods.
|
||||
pub fn maybe_instantiate_inline(ccx: @mut CrateContext, fn_id: ast::def_id,
|
||||
translate: bool)
|
||||
pub fn maybe_instantiate_inline(ccx: @mut CrateContext, fn_id: ast::def_id)
|
||||
-> ast::def_id {
|
||||
let _icx = push_ctxt("maybe_instantiate_inline");
|
||||
match ccx.external.find(&fn_id) {
|
||||
@ -59,7 +55,7 @@ pub fn maybe_instantiate_inline(ccx: @mut CrateContext, fn_id: ast::def_id,
|
||||
csearch::found(ast::ii_item(item)) => {
|
||||
ccx.external.insert(fn_id, Some(item.id));
|
||||
ccx.stats.n_inlines += 1;
|
||||
if translate { trans_item(ccx, item); }
|
||||
trans_item(ccx, item);
|
||||
local_def(item.id)
|
||||
}
|
||||
csearch::found(ast::ii_foreign(item)) => {
|
||||
@ -81,19 +77,19 @@ pub fn maybe_instantiate_inline(ccx: @mut CrateContext, fn_id: ast::def_id,
|
||||
_ => ccx.sess.bug("maybe_instantiate_inline: item has a \
|
||||
non-enum parent")
|
||||
}
|
||||
if translate { trans_item(ccx, item); }
|
||||
trans_item(ccx, item);
|
||||
local_def(my_id)
|
||||
}
|
||||
csearch::found_parent(_, _) => {
|
||||
ccx.sess.bug("maybe_get_item_ast returned a found_parent \
|
||||
with a non-item parent");
|
||||
}
|
||||
csearch::found(ast::ii_method(impl_did, _is_provided, mth)) => {
|
||||
csearch::found(ast::ii_method(impl_did, is_provided, mth)) => {
|
||||
ccx.stats.n_inlines += 1;
|
||||
ccx.external.insert(fn_id, Some(mth.id));
|
||||
// If this is a default method, we can't look up the
|
||||
// impl type. But we aren't going to translate anyways, so don't.
|
||||
if !translate { return local_def(mth.id); }
|
||||
if is_provided { return local_def(mth.id); }
|
||||
|
||||
let impl_tpt = ty::lookup_item_type(ccx.tcx, impl_did);
|
||||
let num_type_params =
|
||||
|
@ -75,7 +75,7 @@ pub fn type_uses_for(ccx: @mut CrateContext, fn_id: def_id, n_tps: uint)
|
||||
let fn_id_loc = if fn_id.crate == local_crate {
|
||||
fn_id
|
||||
} else {
|
||||
inline::maybe_instantiate_inline(ccx, fn_id, true)
|
||||
inline::maybe_instantiate_inline(ccx, fn_id)
|
||||
};
|
||||
|
||||
// Conservatively assume full use for recursive loops
|
||||
|
Loading…
x
Reference in New Issue
Block a user