Skip to content

Commit

Permalink
Merge pull request #28 from Chia-Network/20230911-compile-context
Browse files Browse the repository at this point in the history
20230911 compile context
  • Loading branch information
prozacchiwawa authored Sep 14, 2023
2 parents c753bba + b48b921 commit 8d8f25d
Show file tree
Hide file tree
Showing 6 changed files with 242 additions and 153 deletions.
7 changes: 5 additions & 2 deletions src/classic/clvm_tools/clvmc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ pub fn compile_clvm_text(
let dialect = detect_modern(allocator, assembled_sexp);
// Now the stepping is optional (None for classic) but we may communicate
// other information in dialect as well.
if let Some(dialect) = dialect.stepping {
//
// I think stepping is a good name for the number below as dialect is going
// to get more members that are somewhat independent.
if let Some(stepping) = dialect.stepping {
let runner = Rc::new(DefaultProgramRunner::new());
let opts = opts.set_optimize(true).set_frontend_opt(dialect > 21);
let opts = opts.set_optimize(true).set_frontend_opt(stepping > 21);

let unopt_res = compile_file(allocator, runner.clone(), opts, text, symbol_table);
let res = unopt_res.and_then(|x| run_optimizer(allocator, runner, Rc::new(x)));
Expand Down
Loading

0 comments on commit 8d8f25d

Please sign in to comment.