aboutsummaryrefslogtreecommitdiff
path: root/src/comp/util
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-03-25 10:42:57 -0700
committerPatrick Walton <[email protected]>2011-03-25 10:44:24 -0700
commit77a3373d53e3b0d1b87135b21307f19922398af9 (patch)
tree7ab7d8f75daab48a2d94c042aa6f4ad6a0e73297 /src/comp/util
parentAuto-reconfigure on Makefile.in or configure change. (diff)
downloadrust-77a3373d53e3b0d1b87135b21307f19922398af9.tar.xz
rust-77a3373d53e3b0d1b87135b21307f19922398af9.zip
rustc: Create a crate metadata cache
Diffstat (limited to 'src/comp/util')
-rw-r--r--src/comp/util/common.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/comp/util/common.rs b/src/comp/util/common.rs
index 4b4f5481..b23d6a1e 100644
--- a/src/comp/util/common.rs
+++ b/src/comp/util/common.rs
@@ -64,6 +64,14 @@ fn new_def_hash[V]() -> std.map.hashmap[ast.def_id,V] {
ret std.map.mk_hashmap[ast.def_id,V](hasher, eqer);
}
+fn new_int_hash[V]() -> std.map.hashmap[int,V] {
+ fn hash_int(&int x) -> uint { ret x as uint; }
+ fn eq_int(&int a, &int b) -> bool { ret a == b; }
+ auto hasher = hash_int;
+ auto eqer = eq_int;
+ ret std.map.mk_hashmap[int,V](hasher, eqer);
+}
+
fn istr(int i) -> str {
ret _int.to_str(i, 10u);
}