about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMurarth <murarth@gmail.com>2014-12-02 14:55:07 -0700
committerMurarth <murarth@gmail.com>2014-12-11 15:33:27 -0700
commit04b4b500b9c602c45c7cd5264e969e1a91c1a99d (patch)
tree543fc59789850878ed007bece43072d83cb79cda
parent2c028452b5837a8d35485f24c4b18ede8da6b191 (diff)
downloadrust-04b4b500b9c602c45c7cd5264e969e1a91c1a99d.tar.gz
rust-04b4b500b9c602c45c7cd5264e969e1a91c1a99d.zip
Perform compiler state reset in phase_1
-rw-r--r--src/librustc_driver/driver.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs
index 749bed15e38..78486e128ac 100644
--- a/src/librustc_driver/driver.rs
+++ b/src/librustc_driver/driver.rs
@@ -46,12 +46,6 @@ pub fn compile_input(sess: Session,
                      outdir: &Option<Path>,
                      output: &Option<Path>,
                      addl_plugins: Option<Plugins>) {
-    // These may be left in an incoherent state after a previous compile.
-    // `clear_tables` and `get_ident_interner().clear()` can be used to free
-    // memory, but they do not restore the initial state.
-    syntax::ext::mtwt::reset_tables();
-    token::reset_ident_interner();
-
     // We need nested scopes here, because the intermediate results can keep
     // large chunks of memory alive and we want to free them as soon as
     // possible to keep the peak memory usage low
@@ -115,6 +109,12 @@ pub fn source_name(input: &Input) -> String {
 
 pub fn phase_1_parse_input(sess: &Session, cfg: ast::CrateConfig, input: &Input)
     -> ast::Crate {
+    // These may be left in an incoherent state after a previous compile.
+    // `clear_tables` and `get_ident_interner().clear()` can be used to free
+    // memory, but they do not restore the initial state.
+    syntax::ext::mtwt::reset_tables();
+    token::reset_ident_interner();
+
     let krate = time(sess.time_passes(), "parsing", (), |_| {
         match *input {
             Input::File(ref file) => {