remove mir_passes from Session and add a FIXME

This commit is contained in:
Niko Matsakis 2017-05-02 13:58:49 -04:00
parent afc5acd84b
commit 25be7983e8
4 changed files with 6 additions and 6 deletions

View File

@ -134,6 +134,8 @@ fn run_pass<'a, 'tcx>(&self,
}
/// A manager for MIR passes.
///
/// FIXME(#41712) -- it is unclear whether we should have this struct.
#[derive(Clone)]
pub struct Passes {
pass_hooks: Vec<Rc<PassHook>>,

View File

@ -21,7 +21,6 @@
use ty::tls;
use util::nodemap::{FxHashMap, FxHashSet};
use util::common::duration_to_secs_str;
use mir::transform as mir_pass;
use syntax::ast::NodeId;
use errors::{self, DiagnosticBuilder};
@ -85,7 +84,6 @@ pub struct Session {
/// redundantly verbose output (Issue #24690).
pub one_time_diagnostics: RefCell<FxHashSet<(lint::LintId, Span, String)>>,
pub plugin_llvm_passes: RefCell<Vec<String>>,
pub mir_passes: RefCell<mir_pass::Passes>,
pub plugin_attributes: RefCell<Vec<(String, AttributeType)>>,
pub crate_types: RefCell<Vec<config::CrateType>>,
pub dependency_formats: RefCell<dependency_format::Dependencies>,
@ -670,7 +668,6 @@ pub fn build_session_(sopts: config::Options,
lints: RefCell::new(lint::LintTable::new()),
one_time_diagnostics: RefCell::new(FxHashSet()),
plugin_llvm_passes: RefCell::new(Vec::new()),
mir_passes: RefCell::new(mir_pass::Passes::new()),
plugin_attributes: RefCell::new(Vec::new()),
crate_types: RefCell::new(Vec::new()),
dependency_formats: RefCell::new(FxHashMap()),

View File

@ -20,7 +20,7 @@
use rustc::lint;
use rustc::middle::{self, dependency_format, stability, reachable};
use rustc::middle::privacy::AccessLevels;
use rustc::mir::transform::{MIR_CONST, MIR_VALIDATED, MIR_OPTIMIZED};
use rustc::mir::transform::{MIR_CONST, MIR_VALIDATED, MIR_OPTIMIZED, Passes};
use rustc::ty::{self, TyCtxt, Resolutions, GlobalArenas};
use rustc::util::common::time;
use rustc::util::nodemap::NodeSet;
@ -904,7 +904,7 @@ macro_rules! try_with_f {
rustc_const_eval::provide(&mut extern_providers);
// Setup the MIR passes that we want to run.
let mut passes = sess.mir_passes.borrow().clone();
let mut passes = Passes::new();
passes.push_hook(mir::transform::dump_mir::DumpMir);
// What we need to do constant evaluation.

View File

@ -27,6 +27,7 @@
use rustc::infer::type_variable::TypeVariableOrigin;
use rustc_metadata::cstore::CStore;
use rustc::hir::map as hir_map;
use rustc::mir::transform::Passes;
use rustc::session::{self, config};
use std::rc::Rc;
use syntax::ast;
@ -141,7 +142,7 @@ fn test_env<F>(source_string: &str,
TyCtxt::create_and_enter(&sess,
ty::maps::Providers::default(),
ty::maps::Providers::default(),
Rc::new(sess.mir_passes.borrow().clone()),
Rc::new(Passes::new()),
&arenas,
&arena,
resolutions,