From 29b766029cf6f7dd0e624881281a90b4d43244f8 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 7 Jul 2011 21:43:26 -0700 Subject: [PATCH] Move external crate/lib resolution to its own pass The scope of external crate reading is beyond the resolve pass now, as it builds up tables of information needed for several different purposes. --- src/comp/driver/rustc.rs | 2 ++ src/comp/middle/resolve.rs | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs index bf62ce37d09..697e6c509ca 100644 --- a/src/comp/driver/rustc.rs +++ b/src/comp/driver/rustc.rs @@ -112,6 +112,8 @@ fn compile_input(session::session sess, ast::crate_cfg cfg, str input, } auto ast_map = time(time_passes, "ast indexing", bind middle::ast_map::map_crate(*crate)); + time(time_passes, "external crate/lib resolution", + bind creader::read_crates(sess, *crate)); auto d = time(time_passes, "resolution", bind resolve::resolve_crate(sess, ast_map, crate)); diff --git a/src/comp/middle/resolve.rs b/src/comp/middle/resolve.rs index c01cf90ed93..668ef7596bd 100644 --- a/src/comp/middle/resolve.rs +++ b/src/comp/middle/resolve.rs @@ -7,7 +7,6 @@ import ast::def_id; import ast::node_id; import ast::local_def; -import metadata::creader; import metadata::decoder; import metadata::cstore; import driver::session::session; @@ -125,7 +124,6 @@ tag namespace { ns_value; ns_type; ns_module; } fn resolve_crate(session sess, &ast_map::map amap, @ast::crate crate) -> tup(def_map, constr_table) { - creader::read_crates(sess, *crate); auto e = @rec(crate_map=sess.get_cstore().use_crate_map, def_map=new_int_hash[def](),