Add bugpoint command

Add the command `cargo run --release bugpoint crash.clif 2>/dev/null` to reduce test cases.
This commit is contained in:
bjorn3
2019-08-08 11:40:41 +02:00
committed by Nicolas B. Pierron
parent 73670aab43
commit e6e274a3aa
4 changed files with 2657 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ use std::io::{self, Write};
use std::option::Option;
use std::process;
mod bugpoint;
mod cat;
mod compile;
mod disasm;
@@ -199,6 +200,14 @@ fn main() {
.arg(add_pass_arg())
.arg(add_debug_flag())
.arg(add_time_flag()),
)
.subcommand(
SubCommand::with_name("bugpoint")
.about("Reduce size of clif file causing panic during compilation.")
.arg(add_single_input_file_arg())
.arg(add_set_flag())
.arg(add_target_flag())
.arg(add_verbose_flag()),
);
let res_util = match app_cmds.get_matches().subcommand() {
@@ -284,6 +293,19 @@ fn main() {
result
}
("bugpoint", Some(rest_cmd)) => {
let mut target_val: &str = "";
if let Some(clap_target) = rest_cmd.value_of("target") {
target_val = clap_target;
}
bugpoint::run(
rest_cmd.value_of("single-file").unwrap(),
&get_vec(rest_cmd.values_of("set")),
target_val,
rest_cmd.is_present("verbose"),
)
}
_ => Err("Invalid subcommand.".to_owned()),
};