Remove unused "flav" parameter from function registration paths.

This commit is contained in:
Graydon Hoare 2012-03-20 15:15:57 -07:00
parent d282481c12
commit 56828d49fd
3 changed files with 15 additions and 17 deletions

View File

@ -4162,20 +4162,20 @@ fn get_pair_fn_ty(llpairty: TypeRef) -> TypeRef {
ret struct_elt(llpairty, 0u);
}
fn register_fn(ccx: @crate_ctxt, sp: span, path: path, flav: str,
fn register_fn(ccx: @crate_ctxt, sp: span, path: path,
node_id: ast::node_id) -> ValueRef {
let t = ty::node_id_to_type(ccx.tcx, node_id);
register_fn_full(ccx, sp, path, flav, node_id, t)
register_fn_full(ccx, sp, path, node_id, t)
}
fn register_fn_full(ccx: @crate_ctxt, sp: span, path: path, flav: str,
fn register_fn_full(ccx: @crate_ctxt, sp: span, path: path,
node_id: ast::node_id, node_type: ty::t) -> ValueRef {
let llfty = type_of_fn_from_ty(ccx, node_type);
register_fn_fuller(ccx, sp, path, flav, node_id, node_type,
register_fn_fuller(ccx, sp, path, node_id, node_type,
lib::llvm::CCallConv, llfty)
}
fn register_fn_fuller(ccx: @crate_ctxt, sp: span, path: path, _flav: str,
fn register_fn_fuller(ccx: @crate_ctxt, sp: span, path: path,
node_id: ast::node_id, node_type: ty::t,
cc: lib::llvm::CallConv, llfty: TypeRef) -> ValueRef {
let ps: str = mangle_exported_name(ccx, path, node_type);
@ -4316,7 +4316,7 @@ fn get_item_val(ccx: @crate_ctxt, id: ast::node_id) -> ValueRef {
}
ast::item_fn(decl, _, _) {
let llfn = if decl.purity != ast::crust_fn {
register_fn(ccx, i.span, my_path, "fn", i.id)
register_fn(ccx, i.span, my_path, i.id)
} else {
native::register_crust_fn(ccx, i.span, my_path, i.id)
};
@ -4331,7 +4331,7 @@ fn get_item_val(ccx: @crate_ctxt, id: ast::node_id) -> ValueRef {
// find the dtor symbol.
let t = ty::node_id_to_type(ccx.tcx, dtor_id);
register_fn_full(ccx, i.span, my_path + [path_name("dtor")],
"res_dtor", i.id, t)
i.id, t)
}
}
}
@ -4340,8 +4340,7 @@ fn get_item_val(ccx: @crate_ctxt, id: ast::node_id) -> ValueRef {
let mty = ty::node_id_to_type(ccx.tcx, id);
let pth = *pth + [path_name(ccx.names("meth")),
path_name(m.ident)];
let llfn = register_fn_full(ccx, m.span, pth, "impl_method",
id, mty);
let llfn = register_fn_full(ccx, m.span, pth, id, mty);
set_inline_hint_if_appr(m.attrs, llfn);
llfn
}
@ -4353,13 +4352,12 @@ fn get_item_val(ccx: @crate_ctxt, id: ast::node_id) -> ValueRef {
alt check i.node {
ast::item_res(_, _, _, _, _) {
let my_path = item_path(ccx, i);
let llctor = register_fn(ccx, i.span, my_path, "res_ctor",
id);
let llctor = register_fn(ccx, i.span, my_path, id);
set_inline_hint(llctor);
llctor
}
ast::item_class(_, _, ctor) {
register_fn(ccx, i.span, item_path(ccx, i), "ctor", id)
register_fn(ccx, i.span, item_path(ccx, i), id)
}
}
}
@ -4368,7 +4366,7 @@ fn get_item_val(ccx: @crate_ctxt, id: ast::node_id) -> ValueRef {
let pth = *pth + [path_name(enm.ident), path_name(v.node.name)];
let llfn = alt check enm.node {
ast::item_enum(_, _) {
register_fn(ccx, v.span, pth, "enum", id)
register_fn(ccx, v.span, pth, id)
}
};
set_inline_hint(llfn);

View File

@ -370,7 +370,7 @@ fn trans_expr_fn(bcx: block,
let sub_path = bcx.fcx.path + [path_name("anon")];
let s = mangle_internal_name_by_path(ccx, sub_path);
let llfn = decl_internal_cdecl_fn(ccx.llmod, s, llfnty);
register_fn(ccx, sp, sub_path, "anon fn", id);
register_fn(ccx, sp, sub_path, id);
let trans_closure_env = fn@(ck: ty::closure_kind) -> ValueRef {
let cap_vars = capture::compute_capture_vars(

View File

@ -873,12 +873,12 @@ fn register_crust_fn(ccx: @crate_ctxt, sp: span,
let ret_def = !ty::type_is_bot(ret_ty) && !ty::type_is_nil(ret_ty);
let x86_64 = x86_64_tys(llargtys, llretty, ret_def);
decl_x86_64_fn(x86_64) {|fnty|
register_fn_fuller(ccx, sp, path, "crust fn", node_id,
register_fn_fuller(ccx, sp, path, node_id,
t, lib::llvm::CCallConv, fnty)
}
} else {
let llfty = T_fn(llargtys, llretty);
register_fn_fuller(ccx, sp, path, "crust fn", node_id,
register_fn_fuller(ccx, sp, path, node_id,
t, lib::llvm::CCallConv, llfty)
}
}
@ -920,7 +920,7 @@ fn decl_native_fn(ccx: @crate_ctxt, i: @ast::native_item,
// For true external functions: create a rust wrapper
// and link to that. The rust wrapper will handle
// switching to the C stack.
register_fn(ccx, i.span, pth, "native fn", i.id)
register_fn(ccx, i.span, pth, i.id)
}
}
}