]> git.lizzy.rs Git - rust.git/commitdiff
Fix interaction of --no-analysis and --emit dep-info
authorNick Cameron <ncameron@mozilla.com>
Wed, 14 Jan 2015 20:30:34 +0000 (09:30 +1300)
committerNick Cameron <ncameron@mozilla.com>
Wed, 14 Jan 2015 20:30:34 +0000 (09:30 +1300)
Closes #21130

src/librustc_driver/driver.rs
src/librustc_driver/lib.rs
src/librustc_driver/mod.rs [deleted file]

index f35f8ab1b40f5cb741392bf2cb3b0390b0e1f0aa..be620c72178bbd0a4ee27403ebb578639a4ca39a 100644 (file)
@@ -103,6 +103,13 @@ macro_rules! controller_entry_point{($point: ident, $make_state: expr) => ({
 
         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 @@ pub fn basic() -> 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 @@ fn state_after_expand(input: &'a Input,
         }
     }
 
+    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>,
index 6893c4d72f7ded94ec5461abea8a107babd8a66c..40a3eb9fe5b1d646314c76016e60e427b34b6758 100644 (file)
@@ -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 (file)
index 1fbbc9c..0000000
+++ /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.
-