diff options
Diffstat (limited to 'src/wasm-printing.h')
-rw-r--r-- | src/wasm-printing.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/wasm-printing.h b/src/wasm-printing.h index 936c118ee..d3327aa4c 100644 --- a/src/wasm-printing.h +++ b/src/wasm-printing.h @@ -30,9 +30,13 @@ struct WasmPrinter { static std::ostream& printModule(Module* module); static std::ostream& printExpression(Expression* expression, std::ostream& o, bool minify = false, bool full = false); + + static std::ostream& printStackInst(StackInst* inst, std::ostream& o, Function* func=nullptr); + + static std::ostream& printStackIR(StackIR* ir, std::ostream& o, Function* func=nullptr); }; -} +} // namespace wasm namespace std { @@ -44,6 +48,14 @@ inline std::ostream& operator<<(std::ostream& o, wasm::Expression& expression) { return wasm::WasmPrinter::printExpression(&expression, o); } +inline std::ostream& operator<<(std::ostream& o, wasm::StackInst& inst) { + return wasm::WasmPrinter::printStackInst(&inst, o); } +inline std::ostream& operator<<(std::ostream& o, wasm::StackIR& ir) { + return wasm::WasmPrinter::printStackIR(&ir, o); +} + +} // namespace std + #endif // wasm_wasm_printing_h |