diff --git a/src/rustc/driver/driver.rs b/src/rustc/driver/driver.rs index 9d92a452b67..6aa3451271d 100644 --- a/src/rustc/driver/driver.rs +++ b/src/rustc/driver/driver.rs @@ -187,7 +187,7 @@ fn compile_upto(sess: session, cfg: ast::crate_cfg, exp_map2: exp_map2, trait_map: trait_map } = time(time_passes, ~"resolution", || - middle::resolve3::resolve_crate(sess, lang_items, crate)); + middle::resolve::resolve_crate(sess, lang_items, crate)); let freevars = time(time_passes, ~"freevar finding", || freevars::annotate_freevars(def_map, crate)); diff --git a/src/rustc/metadata.rs b/src/rustc/metadata.rs index 0744430b844..af28556fd33 100644 --- a/src/rustc/metadata.rs +++ b/src/rustc/metadata.rs @@ -5,8 +5,8 @@ mod middle { import ty = middle_::ty; export ty; - import resolve3 = middle_::resolve3; - export resolve3; + import resolve = middle_::resolve; + export resolve; } mod front { diff --git a/src/rustc/metadata/encoder.rs b/src/rustc/metadata/encoder.rs index 1b360b7f782..712d8ef691a 100644 --- a/src/rustc/metadata/encoder.rs +++ b/src/rustc/metadata/encoder.rs @@ -13,7 +13,7 @@ import common::*; import middle::ty; import middle::ty::node_id_to_type; -import middle::resolve3; +import middle::resolve; import syntax::ast_map; import syntax::attr; import std::serialization::serializer; @@ -46,7 +46,7 @@ tcx: ty::ctxt, reachable: hashmap, reexports: ~[(~str, def_id)], - reexports2: middle::resolve3::ExportMap2, + reexports2: middle::resolve::ExportMap2, item_symbols: hashmap, discrim_symbols: hashmap, link_meta: link_meta, @@ -73,7 +73,7 @@ enum encode_ctxt = { stats: stats, reachable: hashmap, reexports: ~[(~str, def_id)], - reexports2: middle::resolve3::ExportMap2, + reexports2: middle::resolve::ExportMap2, item_symbols: hashmap, discrim_symbols: hashmap, link_meta: link_meta, diff --git a/src/rustc/middle/check_const.rs b/src/rustc/middle/check_const.rs index 8c50c9461b7..cc426b5cb74 100644 --- a/src/rustc/middle/check_const.rs +++ b/src/rustc/middle/check_const.rs @@ -5,7 +5,7 @@ import dvec::DVec; fn check_crate(sess: session, crate: @crate, ast_map: ast_map::map, - def_map: resolve3::DefMap, + def_map: resolve::DefMap, method_map: typeck::method_map, tcx: ty::ctxt) { visit::visit_crate(*crate, false, visit::mk_vt(@{ visit_item: |a,b,c| check_item(sess, ast_map, def_map, a, b, c), @@ -18,7 +18,7 @@ fn check_crate(sess: session, crate: @crate, ast_map: ast_map::map, } fn check_item(sess: session, ast_map: ast_map::map, - def_map: resolve3::DefMap, + def_map: resolve::DefMap, it: @item, &&_is_const: bool, v: visit::vt) { match it.node { item_const(_, ex) => { @@ -55,7 +55,7 @@ fn is_str(e: @expr) -> bool { } } -fn check_expr(sess: session, def_map: resolve3::DefMap, +fn check_expr(sess: session, def_map: resolve::DefMap, method_map: typeck::method_map, tcx: ty::ctxt, e: @expr, &&is_const: bool, v: visit::vt) { if is_const { @@ -143,13 +143,13 @@ fn check_expr(sess: session, def_map: resolve3::DefMap, // Make sure a const item doesn't recursively refer to itself // FIXME: Should use the dependency graph when it's available (#1356) fn check_item_recursion(sess: session, ast_map: ast_map::map, - def_map: resolve3::DefMap, it: @item) { + def_map: resolve::DefMap, it: @item) { type env = { root_it: @item, sess: session, ast_map: ast_map::map, - def_map: resolve3::DefMap, + def_map: resolve::DefMap, idstack: @DVec, }; diff --git a/src/rustc/middle/const_eval.rs b/src/rustc/middle/const_eval.rs index 328430d9464..9cc74c56b90 100644 --- a/src/rustc/middle/const_eval.rs +++ b/src/rustc/middle/const_eval.rs @@ -55,7 +55,7 @@ fn join_all(cs: &[constness]) -> constness { } fn classify(e: @expr, - def_map: resolve3::DefMap, + def_map: resolve::DefMap, tcx: ty::ctxt) -> constness { let did = ast_util::local_def(e.id); match tcx.ccache.find(did) { @@ -168,7 +168,7 @@ fn classify(e: @expr, } fn process_crate(crate: @ast::crate, - def_map: resolve3::DefMap, + def_map: resolve::DefMap, tcx: ty::ctxt) { let v = visit::mk_simple_visitor(@{ visit_expr_post: |e| { classify(e, def_map, tcx); } diff --git a/src/rustc/middle/freevars.rs b/src/rustc/middle/freevars.rs index 72388a8964e..143c494684a 100644 --- a/src/rustc/middle/freevars.rs +++ b/src/rustc/middle/freevars.rs @@ -30,7 +30,7 @@ // Since we want to be able to collect upvars in some arbitrary piece // of the AST, we take a walker function that we invoke with a visitor // in order to start the search. -fn collect_freevars(def_map: resolve3::DefMap, blk: ast::blk) +fn collect_freevars(def_map: resolve::DefMap, blk: ast::blk) -> freevar_info { let seen = int_hash(); let refs = @mut ~[]; @@ -85,7 +85,7 @@ fn ignore_item(_i: @ast::item, &&_depth: int, _v: visit::vt) { } // efficient as it fully recomputes the free variables at every // node of interest rather than building up the free variables in // one pass. This could be improved upon if it turns out to matter. -fn annotate_freevars(def_map: resolve3::DefMap, crate: @ast::crate) -> +fn annotate_freevars(def_map: resolve::DefMap, crate: @ast::crate) -> freevar_map { let freevars = int_hash(); diff --git a/src/rustc/middle/pat_util.rs b/src/rustc/middle/pat_util.rs index f80d4e2a239..9b473c32256 100644 --- a/src/rustc/middle/pat_util.rs +++ b/src/rustc/middle/pat_util.rs @@ -13,7 +13,7 @@ // This is used because same-named variables in alternative patterns need to // use the node_id of their namesake in the first pattern. -fn pat_id_map(dm: resolve3::DefMap, pat: @pat) -> pat_id_map { +fn pat_id_map(dm: resolve::DefMap, pat: @pat) -> pat_id_map { let map = std::map::uint_hash(); do pat_bindings(dm, pat) |_bm, p_id, _s, n| { map.insert(path_to_ident(n), p_id); @@ -21,7 +21,7 @@ fn pat_id_map(dm: resolve3::DefMap, pat: @pat) -> pat_id_map { return map; } -fn pat_is_variant(dm: resolve3::DefMap, pat: @pat) -> bool { +fn pat_is_variant(dm: resolve::DefMap, pat: @pat) -> bool { match pat.node { pat_enum(_, _) => true, pat_ident(_, _, None) => match dm.find(pat.id) { @@ -32,7 +32,7 @@ fn pat_is_variant(dm: resolve3::DefMap, pat: @pat) -> bool { } } -fn pat_bindings(dm: resolve3::DefMap, pat: @pat, +fn pat_bindings(dm: resolve::DefMap, pat: @pat, it: fn(binding_mode, node_id, span, @path)) { do walk_pat(pat) |p| { match p.node { @@ -44,7 +44,7 @@ fn pat_bindings(dm: resolve3::DefMap, pat: @pat, } } -fn pat_binding_ids(dm: resolve3::DefMap, pat: @pat) -> ~[node_id] { +fn pat_binding_ids(dm: resolve::DefMap, pat: @pat) -> ~[node_id] { let mut found = ~[]; pat_bindings(dm, pat, |_bm, b_id, _sp, _pt| vec::push(found, b_id) ); return found; diff --git a/src/rustc/middle/region.rs b/src/rustc/middle/region.rs index f1d97f7ba6c..10bdce082ab 100644 --- a/src/rustc/middle/region.rs +++ b/src/rustc/middle/region.rs @@ -43,7 +43,7 @@ struct ctxt { sess: session; - def_map: resolve3::DefMap; + def_map: resolve::DefMap; // Generated maps: region_map: region_map; @@ -325,7 +325,7 @@ fn resolve_fn(fk: visit::fn_kind, decl: ast::fn_decl, body: ast::blk, visit::visit_fn(fk, decl, body, sp, id, fn_cx, visitor); } -fn resolve_crate(sess: session, def_map: resolve3::DefMap, +fn resolve_crate(sess: session, def_map: resolve::DefMap, crate: @ast::crate) -> region_map { let cx: ctxt = ctxt {sess: sess, def_map: def_map, @@ -373,7 +373,7 @@ fn resolve_crate(sess: session, def_map: resolve3::DefMap, type determine_rp_ctxt_ = { sess: session, ast_map: ast_map::map, - def_map: resolve3::DefMap, + def_map: resolve::DefMap, region_paramd_items: region_paramd_items, dep_map: dep_map, worklist: DVec, @@ -746,7 +746,7 @@ fn determine_rp_in_struct_field(cm: @ast::struct_field, fn determine_rp_in_crate(sess: session, ast_map: ast_map::map, - def_map: resolve3::DefMap, + def_map: resolve::DefMap, crate: @ast::crate) -> region_paramd_items { let cx = determine_rp_ctxt_(@{sess: sess, ast_map: ast_map, diff --git a/src/rustc/middle/resolve3.rs b/src/rustc/middle/resolve.rs similarity index 100% rename from src/rustc/middle/resolve3.rs rename to src/rustc/middle/resolve.rs diff --git a/src/rustc/middle/trans/alt.rs b/src/rustc/middle/trans/alt.rs index 4a610799fff..134e25da11e 100644 --- a/src/rustc/middle/trans/alt.rs +++ b/src/rustc/middle/trans/alt.rs @@ -10,7 +10,7 @@ import syntax::ast::def_id; import syntax::codemap::span; import syntax::print::pprust::pat_to_str; -import middle::resolve3::DefMap; +import middle::resolve::DefMap; import back::abi; import std::map::hashmap; import dvec::DVec; diff --git a/src/rustc/middle/trans/base.rs b/src/rustc/middle/trans/base.rs index 5afab464748..a25b5e28410 100644 --- a/src/rustc/middle/trans/base.rs +++ b/src/rustc/middle/trans/base.rs @@ -5868,8 +5868,8 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt, output: &Path, - emap: resolve3::ExportMap, - emap2: resolve3::ExportMap2, + emap: resolve::ExportMap, + emap2: resolve::ExportMap2, maps: astencode::maps) -> (ModuleRef, link_meta) { diff --git a/src/rustc/middle/trans/common.rs b/src/rustc/middle/trans/common.rs index 1a205929e5c..2f66da09a78 100644 --- a/src/rustc/middle/trans/common.rs +++ b/src/rustc/middle/trans/common.rs @@ -107,8 +107,8 @@ struct BuilderRef_res { externs: hashmap<~str, ValueRef>, intrinsics: hashmap<~str, ValueRef>, item_vals: hashmap, - exp_map: resolve3::ExportMap, - exp_map2: resolve3::ExportMap2, + exp_map: resolve::ExportMap, + exp_map2: resolve::ExportMap2, reachable: reachable::map, item_symbols: hashmap, mut main_fn: Option, diff --git a/src/rustc/middle/trans/reachable.rs b/src/rustc/middle/trans/reachable.rs index 319a2f5db7d..b252351cd98 100644 --- a/src/rustc/middle/trans/reachable.rs +++ b/src/rustc/middle/trans/reachable.rs @@ -17,12 +17,12 @@ type map = std::map::hashmap; -type ctx = {exp_map: resolve3::ExportMap, +type ctx = {exp_map: resolve::ExportMap, tcx: ty::ctxt, method_map: typeck::method_map, rmap: map}; -fn find_reachable(crate_mod: _mod, exp_map: resolve3::ExportMap, +fn find_reachable(crate_mod: _mod, exp_map: resolve::ExportMap, tcx: ty::ctxt, method_map: typeck::method_map) -> map { let rmap = std::map::int_hash(); let cx = {exp_map: exp_map, tcx: tcx, method_map: method_map, rmap: rmap}; diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs index 7666672406a..18d54dbf5d8 100644 --- a/src/rustc/middle/ty.rs +++ b/src/rustc/middle/ty.rs @@ -253,7 +253,7 @@ enum region_variance { rv_covariant, rv_invariant, rv_contravariant } vecs_implicitly_copyable: bool, cstore: metadata::cstore::cstore, sess: session::session, - def_map: resolve3::DefMap, + def_map: resolve::DefMap, region_map: middle::region::region_map, region_paramd_items: middle::region::region_paramd_items, @@ -603,7 +603,7 @@ fn new_ty_hash() -> map::hashmap { } fn mk_ctxt(s: session::session, - dm: resolve3::DefMap, + dm: resolve::DefMap, amap: ast_map::map, freevars: freevars::freevar_map, region_map: middle::region::region_map, diff --git a/src/rustc/middle/typeck.rs b/src/rustc/middle/typeck.rs index 51c152f3948..1fa619a1ca3 100644 --- a/src/rustc/middle/typeck.rs +++ b/src/rustc/middle/typeck.rs @@ -157,13 +157,13 @@ fn foo(a: T) -- a's vtable would have a // Maps from a trait's def_id to a MethodInfo about // that method in that trait. type provided_methods_map = hashmap; + ~[@resolve::MethodInfo]>; type ty_param_substs_and_ty = {substs: ty::substs, ty: ty::t}; type crate_ctxt_ = {// A mapping from method call sites to traits that have // that method. - trait_map: resolve3::TraitMap, + trait_map: resolve::TraitMap, method_map: method_map, vtable_map: vtable_map, coherence_info: @coherence::CoherenceInfo, @@ -301,7 +301,7 @@ fn check_for_main_fn(ccx: @crate_ctxt) { } fn check_crate(tcx: ty::ctxt, - trait_map: resolve3::TraitMap, + trait_map: resolve::TraitMap, crate: @ast::crate) -> (method_map, vtable_map) { diff --git a/src/rustc/middle/typeck/check/method.rs b/src/rustc/middle/typeck/check/method.rs index fb4d2565c44..bb90bcaea01 100644 --- a/src/rustc/middle/typeck/check/method.rs +++ b/src/rustc/middle/typeck/check/method.rs @@ -1,7 +1,7 @@ /* Code to handle method lookups (which can be quite complex) */ import coherence::get_base_type_def_id; -import middle::resolve3::{Impl, MethodInfo}; +import middle::resolve::{Impl, MethodInfo}; import middle::ty::{mk_box, mk_rptr, mk_uniq}; import syntax::ast::{def_id, sty_static, sty_box, sty_by_ref, sty_region, sty_uniq}; @@ -462,7 +462,7 @@ fn check_type_match(impl_ty: ty::t, } // Returns true if any were added and false otherwise. - fn add_candidates_from_impl(im: @resolve3::Impl, mode: method_lookup_mode) + fn add_candidates_from_impl(im: @resolve::Impl, mode: method_lookup_mode) -> bool { let mut added_any = false; diff --git a/src/rustc/middle/typeck/coherence.rs b/src/rustc/middle/typeck/coherence.rs index 0c89b0abe11..8076da7c971 100644 --- a/src/rustc/middle/typeck/coherence.rs +++ b/src/rustc/middle/typeck/coherence.rs @@ -7,7 +7,7 @@ import metadata::csearch::{each_path, get_impl_traits, get_impls_for_mod}; import metadata::cstore::{cstore, iter_crate_data}; import metadata::decoder::{dl_def, dl_field, dl_impl}; -import middle::resolve3::{Impl, MethodInfo}; +import middle::resolve::{Impl, MethodInfo}; import middle::ty::{get, lookup_item_type, subst, t, ty_box}; import middle::ty::{ty_uniq, ty_ptr, ty_rptr, ty_enum}; import middle::ty::{ty_class, ty_nil, ty_bot, ty_bool, ty_int, ty_uint}; diff --git a/src/rustc/rustc.rc b/src/rustc/rustc.rc index fd6e86c5b8c..ce77613da06 100644 --- a/src/rustc/rustc.rc +++ b/src/rustc/rustc.rc @@ -53,7 +53,7 @@ mod middle { mod reachable; } mod ty; - mod resolve3; + mod resolve; mod typeck { mod check { mod alt;