diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2011-11-17 16:42:17 +0100 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2011-11-18 12:49:01 +0100 |
| commit | 8f8ebb550cf7e641d7dedd56e08efd4f0e15afab (patch) | |
| tree | fce19d94b7df2f56541a51898ca6d0c2048ddef5 /src/comp/driver | |
| parent | 0c97fcbf6689d8d4f466cdea80369ae057a4523e (diff) | |
| download | rust-8f8ebb550cf7e641d7dedd56e08efd4f0e15afab.tar.gz rust-8f8ebb550cf7e641d7dedd56e08efd4f0e15afab.zip | |
Implement a last-use-of-local finding algorithm
Issue #925
Diffstat (limited to 'src/comp/driver')
| -rw-r--r-- | src/comp/driver/rustc.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs index 05fe635b242..518a6251702 100644 --- a/src/comp/driver/rustc.rs +++ b/src/comp/driver/rustc.rs @@ -5,7 +5,8 @@ import metadata::{creader, cstore}; import syntax::parse::{parser}; import syntax::{ast, codemap}; import front::attr; -import middle::{trans, resolve, freevars, kind, ty, typeck, fn_usage}; +import middle::{trans, resolve, freevars, kind, ty, typeck, fn_usage, + last_use}; import syntax::print::{pp, pprust}; import util::{ppaux, filesearch}; import back::link; @@ -138,6 +139,8 @@ fn compile_input(sess: session::session, cfg: ast::crate_cfg, input: str, bind freevars::annotate_freevars(def_map, crate)); let ty_cx = ty::mk_ctxt(sess, def_map, ext_map, ast_map, freevars); time(time_passes, "typechecking", bind typeck::check_crate(ty_cx, crate)); + let last_uses = time(time_passes, "last use finding", + bind last_use::find_last_uses(crate, def_map, ty_cx)); time(time_passes, "function usage", bind fn_usage::check_crate_fn_usage(ty_cx, crate)); time(time_passes, "alt checking", @@ -150,7 +153,8 @@ fn compile_input(sess: session::session, cfg: ast::crate_cfg, input: str, let copy_map = time(time_passes, "alias checking", bind middle::alias::check_crate(ty_cx, crate)); - time(time_passes, "kind checking", bind kind::check_crate(ty_cx, crate)); + time(time_passes, "kind checking", + bind kind::check_crate(ty_cx, last_uses, crate)); time(time_passes, "const checking", bind middle::check_const::check_crate(ty_cx, crate)); if sess.get_opts().no_trans { ret; } |
