Time type checking passes separately

This commit is contained in:
Seo Sanghyeon 2013-03-21 19:28:58 +09:00
parent 64d923f7dd
commit dad5c3029d
2 changed files with 14 additions and 8 deletions

View File

@ -244,11 +244,9 @@ pub fn compile_rest(sess: Session, cfg: ast::crate_cfg,
let ty_cx = ty::mk_ctxt(sess, def_map, ast_map, freevars,
region_map, rp_set, lang_items, crate);
let (method_map, vtable_map) =
time(time_passes, ~"typechecking", ||
typeck::check_crate(ty_cx,
trait_map,
crate));
// passes are timed inside typeck
let (method_map, vtable_map) = typeck::check_crate(
ty_cx, trait_map, crate);
// These next two const passes can probably be merged
time(time_passes, ~"const marking", ||

View File

@ -53,6 +53,7 @@ use core::prelude::*;
use middle::resolve;
use middle::ty::{ty_param_substs_and_ty, vstore_uniq};
use middle::ty;
use util::common::time;
use util::ppaux;
use core::result;
@ -329,6 +330,7 @@ pub fn check_crate(tcx: ty::ctxt,
trait_map: resolve::TraitMap,
crate: @ast::crate)
-> (method_map, vtable_map) {
let time_passes = tcx.sess.time_passes();
let ccx = @mut CrateCtxt {
trait_map: trait_map,
method_map: oldmap::HashMap(),
@ -336,10 +338,16 @@ pub fn check_crate(tcx: ty::ctxt,
coherence_info: @coherence::CoherenceInfo(),
tcx: tcx
};
collect::collect_item_types(ccx, crate);
coherence::check_coherence(ccx, crate);
check::check_item_types(ccx, crate);
time(time_passes, ~"type collecting", ||
collect::collect_item_types(ccx, crate));
time(time_passes, ~"method resolution", ||
coherence::check_coherence(ccx, crate));
time(time_passes, ~"type checking", ||
check::check_item_types(ccx, crate));
check_for_main_fn(ccx);
tcx.sess.abort_if_errors();
(ccx.method_map, ccx.vtable_map)