summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index a6a0f7919..797ce46b1 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -3627,15 +3627,18 @@ printStackIR(StackIR* ir, std::ostream& o, Function* func) {
default:
WASM_UNREACHABLE("unexpeted op");
}
- std::cout << '\n';
+ o << '\n';
}
assert(controlFlowDepth == 0);
return o;
}
-std::ostream& printStackIR(std::ostream& o, Module* module) {
+std::ostream& printStackIR(std::ostream& o, Module* module, bool optimize) {
wasm::PassRunner runner(module);
runner.add("generate-stack-ir");
+ if (optimize) {
+ runner.add("optimize-stack-ir");
+ }
runner.add(std::make_unique<PrintStackIR>(&o));
runner.run();
return o;