Skip to content

Commit

Permalink
convert to library complete
Browse files Browse the repository at this point in the history
  • Loading branch information
oflatt committed May 10, 2024
1 parent 02d4c51 commit bbb5dfa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions bril-rs/brillvm/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct Cli {
pub args: Vec<String>,
}

pub fn run(args: &Cli) {
pub fn run(args: &Cli) -> String {
let mut src = String::new();
if let Some(f) = &args.file {
let path = std::fs::canonicalize(f).unwrap();
Expand Down Expand Up @@ -63,7 +63,8 @@ pub fn run(args: &Cli) {
unsafe {
engine.run_function_as_main(llvm_prog.get_function("main").unwrap(), &args);
}
String::new()
} else {
println!("{}", llvm_prog.to_string());
llvm_prog.to_string()
}
}
2 changes: 1 addition & 1 deletion bril-rs/brillvm/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ use clap::Parser;
fn main() {
let args = Cli::parse();

run(&args);
println!("{}", run(&args));
}

0 comments on commit bbb5dfa

Please sign in to comment.