summaryrefslogtreecommitdiff
path: root/src/js/binaryen.js-post.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/binaryen.js-post.js')
-rw-r--r--src/js/binaryen.js-post.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js
index e34273a2a..8e4d67482 100644
--- a/src/js/binaryen.js-post.js
+++ b/src/js/binaryen.js-post.js
@@ -1162,6 +1162,16 @@ Module['Module'] = function(module) {
out = old;
return ret;
};
+ this['emitStackIR'] = function(optimize) {
+ this['runPasses'](['generate-stack-ir']);
+ if (optimize) this['runPasses'](['optimize-stack-ir']);
+ var old = out;
+ var ret = '';
+ out = function(x) { ret += x + '\n' };
+ this['runPasses'](['print-stack-ir']);
+ out = old;
+ return ret;
+ };
this['emitAsmjs'] = function() {
var old = out;
var ret = '';