Skip to content
Snippets Groups Projects

fix Xdot check, get frontend to compile

Merged Ryan Ziegler requested to merge ryanjz2/hercules-onnx:fix-frontend into main
1 file
+ 13
13
Compare changes
  • Side-by-side
  • Inline
+ 13
13
@@ -14,7 +14,7 @@ mod types;
use codegen::*;
use std::path::PathBuf;
use std::path::Path;
extern crate hercules_ir;
@@ -62,7 +62,9 @@ fn main() {
pm.add_pass(hercules_opt::pass::Pass::Verify);
}
add_verified_pass!(pm, args, PhiElim);
pm.add_pass(hercules_opt::pass::Pass::Xdot(true));
if args.x_dot {
pm.add_pass(hercules_opt::pass::Pass::Xdot(true));
}
add_pass!(pm, args, CCP);
add_pass!(pm, args, DCE);
add_pass!(pm, args, GVN);
@@ -77,17 +79,15 @@ fn main() {
if args.x_dot {
pm.add_pass(hercules_opt::pass::Pass::Xdot(true));
}
match args.output {
Some(file) => pm.add_pass(hercules_opt::pass::Pass::Codegen(file)),
None => {
let mut path = PathBuf::from(src_file);
path.set_extension("hbin");
println!("{:?}", path);
pm.add_pass(hercules_opt::pass::Pass::Codegen(
path.to_str().unwrap().to_string(),
));
}
}
let src_file_path = Path::new(&src_file);
let module_name = String::from(src_file_path.file_stem().unwrap().to_str().unwrap());
let output_folder = match args.output {
Some(output_folder) => output_folder,
None => String::from(src_file_path.parent().unwrap().to_str().unwrap())
};
pm.add_pass(hercules_opt::pass::Pass::Codegen(output_folder, module_name));
let _ = pm.run_passes();
}
Err(errs) => {
Loading