diff options
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 14cb929c5..a5014d034 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -470,7 +470,7 @@ struct PrintSExpression : public WasmVisitor<PrintSExpression, void> { } }; -// Main entry point. Eventually this will direct printing to one of various options. +// Pass entry point. Eventually this will direct printing to one of various options. void Printer::run(PassRunner* runner, Module* module) { PrintSExpression print(o); @@ -479,4 +479,12 @@ void Printer::run(PassRunner* runner, Module* module) { static RegisterPass<Printer> registerPass("print", "print in s-expression format"); +// Print individual expressions + +std::ostream& printWasm(Expression* expression, std::ostream& o) { + PrintSExpression print(o); + print.visit(expression); + return o; +} + } // namespace wasm |