Skip to content

Commit

Permalink
chore: enable hoisting by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Nov 18, 2024
1 parent 1bd37db commit 8582a61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lib/src/compiler/ir/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@ fn ir() {
let mut compiler = Compiler::new();
let w = BufWriter::new(output_file);

compiler.set_ir_writer(w).add_source(source.as_str()).unwrap();
compiler
.common_subexpression_elimination(false)
.hoisting(false)
.set_ir_writer(w)
.add_source(source.as_str())
.unwrap();

#[cfg(feature = "constant-folding")]
{
Expand All @@ -114,6 +119,7 @@ fn ir() {

compiler
.common_subexpression_elimination(true)
.hoisting(false)
.set_ir_writer(w)
.add_source(source.as_str())
.unwrap();
Expand All @@ -124,6 +130,7 @@ fn ir() {
let w = BufWriter::new(output_file);

compiler
.common_subexpression_elimination(false)
.hoisting(true)
.set_ir_writer(w)
.add_source(source.as_str())
Expand Down
2 changes: 1 addition & 1 deletion lib/src/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ impl<'a> Compiler<'a> {
wasm_exports,
relaxed_re_syntax: false,
cse: false,
hoisting: false,
hoisting: true,
error_on_slow_pattern: false,
error_on_slow_loop: false,
next_pattern_id: PatternId(0),
Expand Down

0 comments on commit 8582a61

Please sign in to comment.