From ed77a619dc1550ce4ac4c0c420093b25e687996a Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 20 Feb 2016 18:25:28 -0800 Subject: do not print alignment if it is the implicit default, which is the number of bytes --- src/passes/Print.cpp | 4 ++-- src/wasm-s-parser.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index fddae15ff..3e886074d 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -179,7 +179,7 @@ struct PrintSExpression : public WasmVisitor { if (curr->offset) { o << " offset=" << curr->offset; } - if (curr->align) { + if (curr->align != curr->bytes) { o << " align=" << curr->align; } incIndent(o, indent); @@ -204,7 +204,7 @@ struct PrintSExpression : public WasmVisitor { if (curr->offset) { o << " offset=" << curr->offset; } - if (curr->align) { + if (curr->align != curr->bytes) { o << " align=" << curr->align; } incIndent(o, indent); diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index c6cf1b32d..64f127b91 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -726,7 +726,7 @@ private: ret->signed_ = extra[0] && extra[1] == 's'; size_t i = 1; ret->offset = 0; - ret->align = 0; + ret->align = ret->bytes; while (!s[i]->isList()) { const char *str = s[i]->c_str(); const char *eq = strchr(str, '='); @@ -764,7 +764,7 @@ private: } size_t i = 1; ret->offset = 0; - ret->align = 0; + ret->align = ret->bytes; while (!s[i]->isList()) { const char *str = s[i]->c_str(); const char *eq = strchr(str, '='); -- cgit v1.2.3