Allow hashmaps to infer their types
This commit is contained in:
committed by
Graydon Hoare
parent
24153eb30f
commit
dd502fc6e4
@@ -248,7 +248,7 @@ fn resolve_crate_deps(e: env, cdata: @~[u8]) -> cstore::cnum_map {
|
||||
debug!("resolving deps of external crate");
|
||||
// The map from crate numbers in the crate we're resolving to local crate
|
||||
// numbers
|
||||
let cnum_map = HashMap::<int,ast::crate_num>();
|
||||
let cnum_map = HashMap();
|
||||
for decoder::get_crate_deps(e.intr, cdata).each |dep| {
|
||||
let extrn_cnum = dep.cnum;
|
||||
let cname = dep.name;
|
||||
|
||||
@@ -69,8 +69,8 @@ pure fn p(cstore: cstore) -> cstore_private {
|
||||
}
|
||||
|
||||
fn mk_cstore(intr: ident_interner) -> cstore {
|
||||
let meta_cache = map::HashMap::<int,crate_metadata>();
|
||||
let crate_map = map::HashMap::<int,ast::crate_num>();
|
||||
let meta_cache = map::HashMap();
|
||||
let crate_map = map::HashMap();
|
||||
let mod_path_map = HashMap();
|
||||
return private(@{metas: meta_cache,
|
||||
use_crate_map: crate_map,
|
||||
|
||||
@@ -967,7 +967,7 @@ fn get_crate_module_paths(intr: ident_interner, cdata: cmd)
|
||||
// find all module (path, def_ids), which are not
|
||||
// fowarded path due to renamed import or reexport
|
||||
let mut res = ~[];
|
||||
let mods = map::HashMap::<~str,bool>();
|
||||
let mods = map::HashMap();
|
||||
do iter_crate_items(intr, cdata) |path, did| {
|
||||
let m = mod_of_path(path);
|
||||
if str::is_not_empty(m) {
|
||||
|
||||
@@ -314,7 +314,7 @@ fn Atom(n: uint) -> Atom {
|
||||
|
||||
/// Creates a hash table of atoms.
|
||||
fn atom_hashmap<V:Copy>() -> HashMap<Atom,V> {
|
||||
HashMap::<Atom,V>()
|
||||
HashMap()
|
||||
}
|
||||
|
||||
/// One local scope.
|
||||
|
||||
@@ -1406,9 +1406,9 @@ fn new_fn_ctxt_w_id(ccx: @crate_ctxt, path: path,
|
||||
mut llself: None,
|
||||
mut personality: None,
|
||||
mut loop_ret: None,
|
||||
llargs: HashMap::<int,local_val>(),
|
||||
lllocals: HashMap::<int,local_val>(),
|
||||
llupvars: HashMap::<int,ValueRef>(),
|
||||
llargs: HashMap(),
|
||||
lllocals: HashMap(),
|
||||
llupvars: HashMap(),
|
||||
id: id,
|
||||
param_substs: param_substs,
|
||||
span: sp,
|
||||
@@ -2315,7 +2315,7 @@ fn declare_intrinsics(llmod: ModuleRef) -> HashMap<~str, ValueRef> {
|
||||
let frameaddress = decl_cdecl_fn(llmod, ~"llvm.frameaddress",
|
||||
T_fn(T_frameaddress_args,
|
||||
T_ptr(T_i8())));
|
||||
let intrinsics = HashMap::<~str,ValueRef>();
|
||||
let intrinsics = HashMap();
|
||||
intrinsics.insert(~"llvm.gcroot", gcroot);
|
||||
intrinsics.insert(~"llvm.gcread", gcread);
|
||||
intrinsics.insert(~"llvm.memmove.p0i8.p0i8.i32", memmove32);
|
||||
@@ -2627,17 +2627,17 @@ fn trans_crate(sess: session::session,
|
||||
llmod: llmod,
|
||||
td: td,
|
||||
tn: tn,
|
||||
externs: HashMap::<~str,ValueRef>(),
|
||||
externs: HashMap(),
|
||||
intrinsics: intrinsics,
|
||||
item_vals: HashMap::<int,ValueRef>(),
|
||||
item_vals: HashMap(),
|
||||
exp_map2: emap2,
|
||||
reachable: reachable,
|
||||
item_symbols: HashMap::<int,~str>(),
|
||||
item_symbols: HashMap(),
|
||||
mut main_fn: None::<ValueRef>,
|
||||
link_meta: link_meta,
|
||||
enum_sizes: ty::new_ty_hash(),
|
||||
discrims: HashMap(),
|
||||
discrim_symbols: HashMap::<int,~str>(),
|
||||
discrim_symbols: HashMap(),
|
||||
tydescs: ty::new_ty_hash(),
|
||||
mut finished_tydescs: false,
|
||||
external: HashMap(),
|
||||
@@ -2646,15 +2646,15 @@ fn trans_crate(sess: session::session,
|
||||
type_use_cache: HashMap(),
|
||||
vtables: map::HashMap(),
|
||||
const_cstr_cache: HashMap(),
|
||||
const_globals: HashMap::<int,ValueRef>(),
|
||||
module_data: HashMap::<~str,ValueRef>(),
|
||||
const_globals: HashMap(),
|
||||
module_data: HashMap(),
|
||||
lltypes: ty::new_ty_hash(),
|
||||
names: new_namegen(sess.parse_sess.interner),
|
||||
next_addrspace: new_addrspace_gen(),
|
||||
symbol_hasher: symbol_hasher,
|
||||
type_hashcodes: ty::new_ty_hash(),
|
||||
type_short_names: ty::new_ty_hash(),
|
||||
all_llvm_symbols: HashMap::<~str,()>(),
|
||||
all_llvm_symbols: HashMap(),
|
||||
tcx: tcx,
|
||||
maps: maps,
|
||||
stats:
|
||||
@@ -2672,7 +2672,7 @@ fn trans_crate(sess: session::session,
|
||||
upcalls:
|
||||
upcall::declare_upcalls(targ_cfg, tn, tydesc_type,
|
||||
llmod),
|
||||
rtcalls: HashMap::<~str,ast::def_id>(),
|
||||
rtcalls: HashMap(),
|
||||
tydesc_type: tydesc_type,
|
||||
int_type: int_type,
|
||||
float_type: float_type,
|
||||
@@ -2683,7 +2683,7 @@ fn trans_crate(sess: session::session,
|
||||
crate_map: crate_map,
|
||||
mut uses_gc: false,
|
||||
dbg_cx: dbg_cx,
|
||||
class_ctors: HashMap::<int,ast::def_id>(),
|
||||
class_ctors: HashMap(),
|
||||
mut do_not_commit_warning_issued: false};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user