about summary refs log tree commit diff
path: root/src/librustc_driver
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-15 14:11:57 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-15 14:11:57 -0800
commit9d4d5ca6e7d19fd9be6775289e465fefddab69f5 (patch)
treea59dd19ed1104f343b677c0656c9185281b55f55 /src/librustc_driver
parent7101ae468602939f0a1185be25949aa848bd3767 (diff)
parent6f9e1a0042322c2804bbbffb8f2674eb5b562fab (diff)
downloadrust-9d4d5ca6e7d19fd9be6775289e465fefddab69f5.tar.gz
rust-9d4d5ca6e7d19fd9be6775289e465fefddab69f5.zip
rollup merge of #21156: nick29581/plugins-fix
Closes #21130

r? @Aatch
Diffstat (limited to 'src/librustc_driver')
-rw-r--r--src/librustc_driver/driver.rs22
-rw-r--r--src/librustc_driver/lib.rs2
-rw-r--r--src/librustc_driver/mod.rs10
3 files changed, 23 insertions, 11 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs
index f35f8ab1b40..be620c72178 100644
--- a/src/librustc_driver/driver.rs
+++ b/src/librustc_driver/driver.rs
@@ -103,6 +103,13 @@ pub fn compile_input(sess: Session,
 
         write_out_deps(&sess, input, &outputs, &id[]);
 
+        controller_entry_point!(after_write_deps,
+                                CompileState::state_after_write_deps(input,
+                                                                     &sess,
+                                                                     outdir,
+                                                                     &ast_map,
+                                                                     &id[]));
+
         let arenas = ty::CtxtArenas::new();
         let analysis = phase_3_run_analysis_passes(sess,
                                                    ast_map,
@@ -176,6 +183,7 @@ pub fn source_name(input: &Input) -> String {
 pub struct CompileController<'a> {
     pub after_parse: PhaseController<'a>,
     pub after_expand: PhaseController<'a>,
+    pub after_write_deps: PhaseController<'a>,
     pub after_analysis: PhaseController<'a>,
     pub after_llvm: PhaseController<'a>,
 
@@ -187,6 +195,7 @@ impl<'a> CompileController<'a> {
         CompileController {
             after_parse: PhaseController::basic(),
             after_expand: PhaseController::basic(),
+            after_write_deps:  PhaseController::basic(),
             after_analysis: PhaseController::basic(),
             after_llvm: PhaseController::basic(),
             make_glob_map: resolve::MakeGlobMap::No,
@@ -271,6 +280,19 @@ impl<'a, 'ast, 'tcx> CompileState<'a, 'ast, 'tcx> {
         }
     }
 
+    fn state_after_write_deps(input: &'a Input,
+                              session: &'a Session,
+                              out_dir: &'a Option<Path>,
+                              ast_map: &'a ast_map::Map<'ast>,
+                              crate_name: &'a str)
+                              -> CompileState<'a, 'ast, 'tcx> {
+        CompileState {
+            crate_name: Some(crate_name),
+            ast_map: Some(ast_map),
+            .. CompileState::empty(input, session, out_dir)
+        }
+    }
+
     fn state_after_analysis(input: &'a Input,
                             session: &'a Session,
                             out_dir: &'a Option<Path>,
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index 6893c4d72f7..40a3eb9fe5b 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -207,7 +207,7 @@ fn build_controller<'a>(sess: &Session) -> CompileController<'a> {
     }
 
     if sess.opts.no_analysis || sess.opts.debugging_opts.ast_json {
-        control.after_expand.stop = true;
+        control.after_write_deps.stop = true;
     }
 
     if sess.opts.no_trans {
diff --git a/src/librustc_driver/mod.rs b/src/librustc_driver/mod.rs
deleted file mode 100644
index 1fbbc9c0521..00000000000
--- a/src/librustc_driver/mod.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-