Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ability for plugins to register a MIR pass #40239

Merged
merged 1 commit into from
Mar 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/librustc_driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,

let whitelisted_legacy_custom_derives = registry.take_whitelisted_custom_derives();
let Registry { syntax_exts, early_lint_passes, late_lint_passes, lint_groups,
llvm_passes, attributes, mir_passes, .. } = registry;
llvm_passes, attributes, .. } = registry;

sess.track_errors(|| {
let mut ls = sess.lint_store.borrow_mut();
Expand All @@ -620,7 +620,6 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
}

*sess.plugin_llvm_passes.borrow_mut() = llvm_passes;
sess.mir_passes.borrow_mut().extend(mir_passes);
*sess.plugin_attributes.borrow_mut() = attributes.clone();
})?;

Expand Down
11 changes: 0 additions & 11 deletions src/librustc_plugin/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
use rustc::lint::{EarlyLintPassObject, LateLintPassObject, LintId, Lint};
use rustc::session::Session;

use rustc::mir::transform::MirMapPass;

use syntax::ext::base::{SyntaxExtension, NamedSyntaxExtension, NormalTT, IdentTT};
use syntax::ext::base::MacroExpanderFn;
use syntax::symbol::Symbol;
Expand Down Expand Up @@ -53,9 +51,6 @@ pub struct Registry<'a> {
#[doc(hidden)]
pub late_lint_passes: Vec<LateLintPassObject>,

#[doc(hidden)]
pub mir_passes: Vec<Box<for<'pcx> MirMapPass<'pcx>>>,

#[doc(hidden)]
pub lint_groups: HashMap<&'static str, Vec<LintId>>,

Expand All @@ -81,7 +76,6 @@ impl<'a> Registry<'a> {
lint_groups: HashMap::new(),
llvm_passes: vec![],
attributes: vec![],
mir_passes: Vec::new(),
whitelisted_custom_derives: Vec::new(),
}
}
Expand Down Expand Up @@ -157,11 +151,6 @@ impl<'a> Registry<'a> {
self.lint_groups.insert(name, to.into_iter().map(|x| LintId::of(x)).collect());
}

/// Register a MIR pass
pub fn register_mir_pass(&mut self, pass: Box<for<'pcx> MirMapPass<'pcx>>) {
self.mir_passes.push(pass);
}

/// Register an LLVM pass.
///
/// Registration with LLVM itself is handled through static C++ objects with
Expand Down
55 changes: 0 additions & 55 deletions src/test/run-pass-fulldeps/auxiliary/dummy_mir_pass.rs

This file was deleted.

23 changes: 0 additions & 23 deletions src/test/run-pass-fulldeps/mir-pass.rs

This file was deleted.