Rename resolve3 -> resolve.

This commit is contained in:
Graydon Hoare 2012-08-29 13:26:26 -07:00
parent 6d22a805d7
commit 5eef15df12
18 changed files with 39 additions and 39 deletions

View File

@ -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));

View File

@ -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 {

View File

@ -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<ast::node_id, ()>,
reexports: ~[(~str, def_id)],
reexports2: middle::resolve3::ExportMap2,
reexports2: middle::resolve::ExportMap2,
item_symbols: hashmap<ast::node_id, ~str>,
discrim_symbols: hashmap<ast::node_id, ~str>,
link_meta: link_meta,
@ -73,7 +73,7 @@ enum encode_ctxt = {
stats: stats,
reachable: hashmap<ast::node_id, ()>,
reexports: ~[(~str, def_id)],
reexports2: middle::resolve3::ExportMap2,
reexports2: middle::resolve::ExportMap2,
item_symbols: hashmap<ast::node_id, ~str>,
discrim_symbols: hashmap<ast::node_id, ~str>,
link_meta: link_meta,

View File

@ -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<bool>) {
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<bool>) {
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<node_id>,
};

View File

@ -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); }

View File

@ -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<int>) { }
// 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();

View File

@ -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;

View File

@ -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<ast::node_id>,
@ -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,

View File

@ -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;

View File

@ -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) {

View File

@ -107,8 +107,8 @@ struct BuilderRef_res {
externs: hashmap<~str, ValueRef>,
intrinsics: hashmap<~str, ValueRef>,
item_vals: hashmap<ast::node_id, ValueRef>,
exp_map: resolve3::ExportMap,
exp_map2: resolve3::ExportMap2,
exp_map: resolve::ExportMap,
exp_map2: resolve::ExportMap2,
reachable: reachable::map,
item_symbols: hashmap<ast::node_id, ~str>,
mut main_fn: Option<ValueRef>,

View File

@ -17,12 +17,12 @@
type map = std::map::hashmap<node_id, ()>;
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};

View File

@ -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<V: copy>() -> map::hashmap<t, V> {
}
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,

View File

@ -157,13 +157,13 @@ fn foo<T: quux, baz, bar>(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<ast::node_id,
~[@resolve3::MethodInfo]>;
~[@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) {

View File

@ -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;

View File

@ -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};

View File

@ -53,7 +53,7 @@ mod middle {
mod reachable;
}
mod ty;
mod resolve3;
mod resolve;
mod typeck {
mod check {
mod alt;