Skip to content

Commit

Permalink
fix(compiler): Apply optimization flag at link stage (#1099)
Browse files Browse the repository at this point in the history
  • Loading branch information
ospencer committed Jan 11, 2022
1 parent b58323f commit 49dac79
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion compiler/src/linking/link.re
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,11 @@ let link_modules = ({asm: wasm_mod, signature}) => {
if (Module.validate(linked_mod) != 1) {
failwith("Generated invalid linked module");
};
Module.optimize(linked_mod);
switch (Config.optimization_level^) {
| Level_three => Module.optimize(linked_mod)
| Level_zero
| Level_one
| Level_two => ()
};
linked_mod;
};

0 comments on commit 49dac79

Please sign in to comment.