Add an interpret command to clif-util

This commit is contained in:
Andrew Brown
2020-04-21 12:02:44 -07:00
parent 9cf90b836b
commit b65bd1c8a2
4 changed files with 185 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ mod bugpoint;
mod cat;
mod compile;
mod disasm;
mod interpret;
mod print_cfg;
mod run;
mod utils;
@@ -179,6 +180,13 @@ fn main() {
.arg(add_input_file_arg())
.arg(add_debug_flag()),
)
.subcommand(
SubCommand::with_name("interpret")
.about("Interpret CLIF code")
.arg(add_verbose_flag())
.arg(add_input_file_arg())
.arg(add_debug_flag()),
)
.subcommand(
SubCommand::with_name("cat")
.about("Outputs .clif file")
@@ -239,6 +247,14 @@ fn main() {
)
.map(|_time| ())
}
("interpret", Some(rest_cmd)) => {
handle_debug_flag(rest_cmd.is_present("debug"));
interpret::run(
get_vec(rest_cmd.values_of("file")),
rest_cmd.is_present("verbose"),
)
.map(|_time| ())
}
("pass", Some(rest_cmd)) => {
handle_debug_flag(rest_cmd.is_present("debug"));