From 4165d3640a7b56f0d057a3d55992eb8c9ac05432 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 29 Jun 2011 22:32:08 -0700 Subject: Add a pass to fold out items that do not belong in the current configuration The parser needs to parse unconfigured items into the AST so that they can make the round trip back through the pretty printer, but subsequent passes shouldn't care about items not being translated. Running a fold pass after parsing is the lowest-impact way to make this work. The performance seems fine. Issue #489 --- src/comp/driver/rustc.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/comp/driver') diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs index d83e04e061a..55dcc35a637 100644 --- a/src/comp/driver/rustc.rs +++ b/src/comp/driver/rustc.rs @@ -80,6 +80,8 @@ fn compile_input(session::session sess, eval::env env, str input, auto crate = time(time_passes, "parsing", bind parse_input(sess, p, input)); if (sess.get_opts().output_type == link::output_type_none) { ret; } + crate = time(time_passes, "configuration", + bind front::config::strip_unconfigured_items(crate)); auto ast_map = time(time_passes, "ast indexing", bind middle::ast_map::map_crate(*crate)); auto d = -- cgit 1.4.1-3-g733a5