Skip to content

get rid of the --miri_host_target hack #344

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

Merged
merged 1 commit into from
Sep 16, 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
16 changes: 3 additions & 13 deletions miri/bin/miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ use std::path::PathBuf;

struct MiriCompilerCalls {
default: RustcDefaultCalls,
/// whether we are building for the host
host_target: bool,
}

impl<'a> CompilerCalls<'a> for MiriCompilerCalls {
Expand Down Expand Up @@ -80,8 +78,8 @@ impl<'a> CompilerCalls<'a> for MiriCompilerCalls {
let mut control = self.default.build_controller(sess, matches);
control.after_hir_lowering.callback = Box::new(after_hir_lowering);
control.after_analysis.callback = Box::new(after_analysis);
if !self.host_target {
// only fully compile targets on the host
if sess.target.target != sess.host {
// only fully compile targets on the host. linking will fail for cross-compilation.
control.after_analysis.stop = Compilation::Stop;
}
control
Expand Down Expand Up @@ -258,18 +256,10 @@ fn main() {
args.push(find_sysroot());
}

// for auxilary builds in unit tests
// Make sure we always have all the MIR (e.g. for auxilary builds in unit tests).
args.push("-Zalways-encode-mir".to_owned());
let mut host_target = false;
args.retain(|arg| if arg == "--miri_host_target" {
host_target = true;
false // remove the flag, rustc doesn't know it
} else {
true
});

rustc_driver::run_compiler(&args, &mut MiriCompilerCalls {
default: RustcDefaultCalls,
host_target,
}, None, None);
}
3 changes: 0 additions & 3 deletions tests/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ fn miri_pass(path: &str, target: &str, host: &str, fullmir: bool, opt: bool) {
// For now, only validate without optimizations. Inlining breaks validation.
flags.push("-Zmir-emit-validate=1".to_owned());
}
if target == host {
flags.push("--miri_host_target".to_owned());
}
config.target_rustcflags = Some(flags.join(" "));
compiletest::run_tests(&config);
}
Expand Down