From 6f9e1a0042322c2804bbbffb8f2674eb5b562fab Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Thu, 15 Jan 2015 09:30:34 +1300 Subject: [PATCH] Fix interaction of --no-analysis and --emit dep-info Closes #21130 --- src/librustc_driver/driver.rs | 22 ++++++++++++++++++++++ src/librustc_driver/lib.rs | 2 +- src/librustc_driver/mod.rs | 10 ---------- 3 files changed, 23 insertions(+), 11 deletions(-) delete mode 100644 src/librustc_driver/mod.rs 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, + 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, 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. -