summaryrefslogtreecommitdiff
path: root/src/dataflow
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-12-17 12:39:21 -0800
committerGitHub <noreply@github.com>2020-12-17 12:39:21 -0800
commit2257f857069faa56335d2e24d7d6853c9501fcb7 (patch)
treeca67dc5b66b7d24759fc1043ed154b7f002a0188 /src/dataflow
parenta8ded16f56afd880a9a6459fe5ce55a8667d9b3e (diff)
downloadbinaryen-2257f857069faa56335d2e24d7d6853c9501fcb7.tar.gz
binaryen-2257f857069faa56335d2e24d7d6853c9501fcb7.tar.bz2
binaryen-2257f857069faa56335d2e24d7d6853c9501fcb7.zip
Refactor printing code so that printing Expressions always works (#3450)
This avoids needing to add include wasm-printing if a file doesn't already have it. To achieve that, add the std::ostream hooks in wasm.h, and also use them when possible, removing the need for the special WasmPrinter object. Also stop printing in "full" (print types on each line) in error messages by default. The user can still get that, as always, using BINARYEN_PRINT_FULL=1 in the env.
Diffstat (limited to 'src/dataflow')
-rw-r--r--src/dataflow/utils.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/dataflow/utils.h b/src/dataflow/utils.h
index 436ccc4d8..02625212e 100644
--- a/src/dataflow/utils.h
+++ b/src/dataflow/utils.h
@@ -26,7 +26,6 @@
#define wasm_dataflow_utils_h
#include "dataflow/node.h"
-#include "wasm-printing.h"
#include "wasm.h"
namespace wasm {
@@ -47,7 +46,7 @@ inline std::ostream& dump(Node* node, std::ostream& o, size_t indent = 0) {
break;
case Node::Type::Expr: {
o << "expr ";
- WasmPrinter::printExpression(node->expr, o, true);
+ o << *node->expr << '\n';
break;
}
case Node::Type::Phi: