diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2011-06-19 22:41:21 +0200 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2011-06-20 23:53:28 +0200 |
| commit | 75681f9ad7a6b79c5a34fd80c95c22258e30ddb5 (patch) | |
| tree | 53a7bfddff8a8b8c5ba22b8bcaeb60b3c680b443 /src/comp/driver | |
| parent | 3d8a5cb9e67d0e38d2062bd7685aa5514305dfc6 (diff) | |
| download | rust-75681f9ad7a6b79c5a34fd80c95c22258e30ddb5.tar.gz rust-75681f9ad7a6b79c5a34fd80c95c22258e30ddb5.zip | |
Get rid of def_ids and anns in AST nodes, use single node_id
This reduces some redundancy in the AST data structures and cruft in the code that works with them. To get a def_id from a node_id, apply ast::local_def, which adds the local crate_num to the given node_id. Most code only deals with crate-local node_ids, and won't have to create def_ids at all.
Diffstat (limited to 'src/comp/driver')
| -rw-r--r-- | src/comp/driver/rustc.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs index 0acf1dfac87..f5f79fb0a2a 100644 --- a/src/comp/driver/rustc.rs +++ b/src/comp/driver/rustc.rs @@ -76,8 +76,7 @@ fn time[T](bool do_it, str what, fn() -> T thunk) -> T { fn compile_input(session::session sess, eval::env env, str input, str output) { auto time_passes = sess.get_opts().time_passes; - auto def = tup(ast::local_crate, 0); - auto p = parser::new_parser(sess, env, def, input, 0u, 0u); + auto p = parser::new_parser(sess, env, input, 0u, 0); auto crate = time(time_passes, "parsing", bind parse_input(sess, p, input)); if (sess.get_opts().output_type == link::output_type_none) { ret; } @@ -103,8 +102,7 @@ fn compile_input(session::session sess, eval::env env, str input, fn pretty_print_input(session::session sess, eval::env env, str input, pp_mode ppm) { - auto def = tup(ast::local_crate, 0); - auto p = front::parser::new_parser(sess, env, def, input, 0u, 0u); + auto p = front::parser::new_parser(sess, env, input, 0u, 0); auto crate = parse_input(sess, p, input); auto mode; alt (ppm) { |
