// Cache of external const values
extern_const_values: HashMap<ast::DefId, ValueRef>,
- impl_method_cache: HashMap<(ast::DefId, ast::Ident), ast::DefId>,
+ impl_method_cache: HashMap<(ast::DefId, ast::Name), ast::DefId>,
module_data: HashMap<~str, ValueRef>,
lltypes: HashMap<ty::t, Type>,
typeck::vtable_static(impl_did, ref rcvr_substs, rcvr_origins) => {
assert!(rcvr_substs.iter().all(|t| !ty::type_needs_infer(*t)));
- let mth_id = method_with_name(bcx.ccx(), impl_did, mname);
+ let mth_id = method_with_name(bcx.ccx(), impl_did, mname.name);
let (callee_substs, callee_origins) =
combine_impl_and_methods_tps(
bcx, mth_id, callee_id,
pub fn method_with_name(ccx: &mut CrateContext,
impl_id: ast::DefId,
- name: ast::Ident) -> ast::DefId {
- // NOTE : SHOULD USE NAME (chonged later)
+ name: ast::Name) -> ast::DefId {
let meth_id_opt = ccx.impl_method_cache.find_copy(&(impl_id, name));
match meth_id_opt {
Some(m) => return m,
let imp = ccx.tcx.impls.find(&impl_id)
.expect("could not find impl while translating");
- let meth = imp.methods.iter().find(|m| m.ident.name == name.name)
+ let meth = imp.methods.iter().find(|m| m.ident.name == name)
.expect("could not find method while translating");
ccx.impl_method_cache.insert((impl_id, name), meth.def_id);
typeck::vtable_static(impl_did, ref rcvr_substs, rcvr_origins) => {
let ccx = bcx.ccx();
let mname = ty::trait_method(ccx.tcx, trait_id, n_method).ident;
- let mth_id = method_with_name(bcx.ccx(), impl_did, mname);
+ let mth_id = method_with_name(bcx.ccx(), impl_did, mname.name);
// obtain the `self` value:
let mut temp_cleanups = ~[];
let ident = ty::method(tcx, *method_def_id).ident;
// The substitutions we have are on the impl, so we grab
// the method type from the impl to substitute into.
- let m_id = method_with_name(ccx, impl_id, ident);
+ let m_id = method_with_name(ccx, impl_id, ident.name);
let m = ty::method(tcx, m_id);
debug!("(making impl vtable) emitting method %s at subst %s",
m.repr(tcx),