summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2019-02-27 13:54:07 -0800
committerGitHub <noreply@github.com>2019-02-27 13:54:07 -0800
commit23ce677fdb0af5af919bf8faf0be04c3692cc457 (patch)
tree2566e3241cb505c0a3a5a449d02746bd90c5677b /src/passes/Print.cpp
parentc6237e8ea6236aa4a622cae64517cc3fd4f27b83 (diff)
downloadbinaryen-23ce677fdb0af5af919bf8faf0be04c3692cc457.tar.gz
binaryen-23ce677fdb0af5af919bf8faf0be04c3692cc457.tar.bz2
binaryen-23ce677fdb0af5af919bf8faf0be04c3692cc457.zip
Simplify ExpressionAnalyzer (#1920)
This refactors the hashing and comparison code to use a single immediate-value iterator. This makes us have a single place that knows the list of immediate fields in every node type, instead of 2. This also fixes a few bugs found by doing that. In particular, this makes us slightly slower than before since we are hashing more fields.
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index c511af434..fd0bf17dc 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -135,7 +135,7 @@ struct PrintExpressionContents : public Visitor<PrintExpressionContents> {
prepareColor(o) << printType(curr->type);
if (curr->isAtomic) o << ".atomic";
o << ".load";
- if (curr->bytes < 4 || (curr->type == i64 && curr->bytes < 8)) {
+ if (curr->type != unreachable && curr->bytes < getTypeSize(curr->type)) {
if (curr->bytes == 1) {
o << '8';
} else if (curr->bytes == 2) {