about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-01-31 18:18:07 -0500
committerDaniel Micay <danielmicay@gmail.com>2013-01-31 23:13:56 -0500
commit70855f5a07bb17e6690c32832dec452cb211b18a (patch)
treeb9bffafcba4e94f4dc530c88f625fb8cf3bf19b4
parent9ba7114515db355ca36065d2730e3ee6c84cd6d1 (diff)
downloadrust-70855f5a07bb17e6690c32832dec452cb211b18a.tar.gz
rust-70855f5a07bb17e6690c32832dec452cb211b18a.zip
move smallintmap to oldsmallintmap
-rw-r--r--src/librustc/middle/lint.rs11
-rw-r--r--src/librustc/middle/trans/base.rs2
-rw-r--r--src/librustc/middle/ty.rs10
-rw-r--r--src/librustc/middle/typeck/infer/mod.rs4
-rw-r--r--src/librustc/middle/typeck/infer/unify.rs2
-rw-r--r--src/librustc/middle/typeck/mod.rs4
-rw-r--r--src/libstd/oldsmallintmap.rs (renamed from src/libstd/smallintmap.rs)2
-rw-r--r--src/libstd/std.rc2
-rw-r--r--src/test/bench/std-smallintmap.rs8
9 files changed, 23 insertions, 22 deletions
diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs
index 9017b1e1537..daa335fed93 100644
--- a/src/librustc/middle/lint.rs
+++ b/src/librustc/middle/lint.rs
@@ -34,8 +34,8 @@ use core::uint;
 use core::vec;
 use std::map::{Map, HashMap};
 use std::map;
-use std::smallintmap::{Map, SmallIntMap};
-use std::smallintmap;
+use std::oldsmallintmap::{Map, SmallIntMap};
+use std::oldsmallintmap;
 use syntax::ast_util::{path_to_ident};
 use syntax::attr;
 use syntax::codemap::span;
@@ -248,7 +248,7 @@ pub type lint_settings = {
 };
 
 pub fn mk_lint_settings() -> lint_settings {
-    {default_settings: smallintmap::mk(),
+    {default_settings: oldsmallintmap::mk(),
      settings_map: HashMap()}
 }
 
@@ -273,7 +273,8 @@ pub fn get_lint_settings_level(settings: lint_settings,
 // This is kind of unfortunate. It should be somewhere else, or we should use
 // a persistent data structure...
 fn clone_lint_modes(modes: lint_modes) -> lint_modes {
-    smallintmap::SmallIntMap_(@smallintmap::SmallIntMap_ { v: copy modes.v })
+    oldsmallintmap::SmallIntMap_(@oldsmallintmap::SmallIntMap_
+    {v: copy modes.v})
 }
 
 type ctxt_ = {dict: lint_dict,
@@ -393,7 +394,7 @@ fn build_settings_item(i: @ast::item, &&cx: ctxt, v: visit::vt<ctxt>) {
 
 pub fn build_settings_crate(sess: session::Session, crate: @ast::crate) {
     let cx = ctxt_({dict: get_lint_dict(),
-                    curr: smallintmap::mk(),
+                    curr: oldsmallintmap::mk(),
                     is_default: true,
                     sess: sess});
 
diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs
index dd4c773278f..d0f9c931616 100644
--- a/src/librustc/middle/trans/base.rs
+++ b/src/librustc/middle/trans/base.rs
@@ -76,7 +76,7 @@ use core::option::{is_none, is_some};
 use core::option;
 use core::uint;
 use std::map::HashMap;
-use std::smallintmap;
+use std::oldsmallintmap;
 use std::{map, time, list};
 use syntax::ast_map::{path, path_elt_to_str, path_mod, path_name};
 use syntax::ast_util::{def_id_of_def, local_def, path_to_ident};
diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs
index 928a1cfa967..b07e3ef7b81 100644
--- a/src/librustc/middle/ty.rs
+++ b/src/librustc/middle/ty.rs
@@ -42,7 +42,7 @@ use core::to_bytes;
 use core::uint;
 use core::vec;
 use std::map::HashMap;
-use std::{map, smallintmap};
+use std::{map, oldsmallintmap};
 use syntax::ast::*;
 use syntax::ast_util::{is_local, local_def};
 use syntax::ast_util;
@@ -785,7 +785,7 @@ type type_cache = HashMap<ast::def_id, ty_param_bounds_and_ty>;
 
 type constness_cache = HashMap<ast::def_id, const_eval::constness>;
 
-pub type node_type_table = @smallintmap::SmallIntMap<t>;
+pub type node_type_table = @oldsmallintmap::SmallIntMap<t>;
 
 fn mk_rcache() -> creader_cache {
     type val = {cnum: int, pos: uint, len: uint};
@@ -837,7 +837,7 @@ pub fn mk_ctxt(s: session::Session,
         def_map: dm,
         region_map: region_map,
         region_paramd_items: region_paramd_items,
-        node_types: @smallintmap::mk(),
+        node_types: @oldsmallintmap::mk(),
         node_type_substs: map::HashMap(),
         items: amap,
         intrinsic_defs: map::HashMap(),
@@ -2799,7 +2799,7 @@ pub fn br_hashmap<V:Copy>() -> HashMap<bound_region, V> {
 
 pub fn node_id_to_type(cx: ctxt, id: ast::node_id) -> t {
     //io::println(fmt!("%?/%?", id, cx.node_types.size()));
-    match smallintmap::find(*cx.node_types, id as uint) {
+    match oldsmallintmap::find(*cx.node_types, id as uint) {
        Some(t) => t,
        None => cx.sess.bug(
            fmt!("node_id_to_type: no type for node `%s`",
@@ -3175,7 +3175,7 @@ pub fn expr_kind(tcx: ctxt,
         }
 
         ast::expr_cast(*) => {
-            match smallintmap::find(*tcx.node_types, expr.id as uint) {
+            match oldsmallintmap::find(*tcx.node_types, expr.id as uint) {
                 Some(t) => {
                     if ty::type_is_immediate(t) {
                         RvalueDatumExpr
diff --git a/src/librustc/middle/typeck/infer/mod.rs b/src/librustc/middle/typeck/infer/mod.rs
index 2272e99995d..2a39022e8d4 100644
--- a/src/librustc/middle/typeck/infer/mod.rs
+++ b/src/librustc/middle/typeck/infer/mod.rs
@@ -281,7 +281,7 @@ use core::result;
 use core::vec;
 use std::list::Nil;
 use std::map::HashMap;
-use std::smallintmap;
+use std::oldsmallintmap;
 use syntax::ast::{ret_style, purity};
 use syntax::ast::{m_const, m_imm, m_mutbl};
 use syntax::ast::{unsafe_fn, impure_fn, pure_fn, extern_fn};
@@ -353,7 +353,7 @@ pub fn fixup_err_to_str(f: fixup_err) -> ~str {
 
 fn new_ValsAndBindings<V:Copy, T:Copy>() -> ValsAndBindings<V, T> {
     ValsAndBindings {
-        vals: smallintmap::mk(),
+        vals: oldsmallintmap::mk(),
         mut bindings: ~[]
     }
 }
diff --git a/src/librustc/middle/typeck/infer/unify.rs b/src/librustc/middle/typeck/infer/unify.rs
index 30329f29945..3b38197c51c 100644
--- a/src/librustc/middle/typeck/infer/unify.rs
+++ b/src/librustc/middle/typeck/infer/unify.rs
@@ -10,7 +10,7 @@
 
 use core::prelude::*;
 use core::result;
-use std::smallintmap::SmallIntMap;
+use std::oldsmallintmap::SmallIntMap;
 
 use middle::ty::{Vid, expected_found, IntVarValue};
 use middle::ty;
diff --git a/src/librustc/middle/typeck/mod.rs b/src/librustc/middle/typeck/mod.rs
index ae57cd90bd7..5059de13149 100644
--- a/src/librustc/middle/typeck/mod.rs
+++ b/src/librustc/middle/typeck/mod.rs
@@ -69,7 +69,7 @@ use std::list::{List, Nil, Cons};
 use std::list;
 use std::map::HashMap;
 use std::map;
-use std::smallintmap;
+use std::oldsmallintmap;
 use syntax::ast::{provided, required, spanned};
 use syntax::ast_map::node_id_to_str;
 use syntax::ast_util::{local_def, respan, split_trait_methods};
@@ -212,7 +212,7 @@ pub enum crate_ctxt {
 // Functions that write types into the node type table
 pub fn write_ty_to_tcx(tcx: ty::ctxt, node_id: ast::node_id, ty: ty::t) {
     debug!("write_ty_to_tcx(%d, %s)", node_id, ppaux::ty_to_str(tcx, ty));
-    smallintmap::insert(*tcx.node_types, node_id as uint, ty);
+    oldsmallintmap::insert(*tcx.node_types, node_id as uint, ty);
 }
 pub fn write_substs_to_tcx(tcx: ty::ctxt,
                            node_id: ast::node_id,
diff --git a/src/libstd/smallintmap.rs b/src/libstd/oldsmallintmap.rs
index 59ae9f68d6e..803e75e4cf7 100644
--- a/src/libstd/smallintmap.rs
+++ b/src/libstd/oldsmallintmap.rs
@@ -172,7 +172,7 @@ impl<V: Copy> SmallIntMap<V>: ops::Index<uint, V> {
 
 #[cfg(test)]
 mod tests {
-    use smallintmap::{mk, SmallIntMap};
+    use super::{mk, SmallIntMap};
 
     use core::option::None;
 
diff --git a/src/libstd/std.rc b/src/libstd/std.rc
index 51b55b1c46f..86b0f680234 100644
--- a/src/libstd/std.rc
+++ b/src/libstd/std.rc
@@ -82,7 +82,7 @@ pub mod list;
 pub mod map;
 pub mod priority_queue;
 pub mod rope;
-pub mod smallintmap;
+pub mod oldsmallintmap;
 pub mod sort;
 pub mod treemap;
 
diff --git a/src/test/bench/std-smallintmap.rs b/src/test/bench/std-smallintmap.rs
index a72831c2b06..60efb14e2dc 100644
--- a/src/test/bench/std-smallintmap.rs
+++ b/src/test/bench/std-smallintmap.rs
@@ -8,11 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// Microbenchmark for the smallintmap library
+// Microbenchmark for the oldsmallintmap library
 
 extern mod std;
-use std::smallintmap;
-use std::smallintmap::SmallIntMap;
+use std::oldsmallintmap;
+use std::oldsmallintmap::SmallIntMap;
 use io::WriterUtil;
 
 fn append_sequential(min: uint, max: uint, map: SmallIntMap<uint>) {
@@ -43,7 +43,7 @@ fn main() {
     let mut appendf = 0.0;
 
     for uint::range(0u, rep) |_r| {
-        let map = smallintmap::mk();
+        let map = oldsmallintmap::mk();
         let start = std::time::precise_time_s();
         append_sequential(0u, max, map);
         let mid = std::time::precise_time_s();