diff options
author | Daniel Wirtz <dcode@dcode.io> | 2017-10-30 19:27:31 +0100 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2017-10-30 11:27:31 -0700 |
commit | 7a4c47e7d4e70404249af4a9ac4ffcbe23d2cd67 (patch) | |
tree | cdc39bf0db7d76318e56c41ecd633a8ced877e01 /src/js | |
parent | da871deea05366006a3942cebb61e8463c1c4100 (diff) | |
download | binaryen-7a4c47e7d4e70404249af4a9ac4ffcbe23d2cd67.tar.gz binaryen-7a4c47e7d4e70404249af4a9ac4ffcbe23d2cd67.tar.bz2 binaryen-7a4c47e7d4e70404249af4a9ac4ffcbe23d2cd67.zip |
Added the ability to run specific optimization passes to binaryen-c/.js (#1252)
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/binaryen.js-post.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index 985691494..d4e2cbf80 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -847,6 +847,13 @@ this['optimize'] = function() { return Module['_BinaryenModuleOptimize'](module); }; + this['runPasses'] = function(passes) { + return preserveStack(function() { + return Module['_BinaryenModuleRunPasses'](module, i32sToStack( + passes.map(strToStack) + ), passes.length); + }); + } this['autoDrop'] = function() { return Module['_BinaryenModuleAutoDrop'](module); }; |