From db66e646df6512d4eb2be344778001c62402e4c5 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 22 Sep 2017 12:52:35 -0700 Subject: Update text syntax for shared memory limits (#1197) Following WebAssembly/threads#58 e.g. (memory $0 23 256 shared) is now (memory $0 (shared 23 256)) --- src/passes/Print.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/passes/Print.cpp') diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 04b649ff6..8bb5175ab 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -718,7 +718,7 @@ struct PrintSExpression : public Visitor { void printTableHeader(Table* curr) { printOpening(o, "table") << ' '; o << curr->initial; - if (curr->max != Table::kMaxSize) o << ' ' << curr->max; + if (curr->hasMax()) o << ' ' << curr->max; o << " anyfunc)"; } void visitTable(Table *curr) { @@ -746,9 +746,10 @@ struct PrintSExpression : public Visitor { void printMemoryHeader(Memory* curr) { printOpening(o, "memory") << ' '; printName(curr->name) << ' '; + if (curr->shared) printOpening(o, "shared "); o << curr->initial; - if (curr->max && curr->max != Memory::kMaxSize) o << ' ' << curr->max; - if (curr->shared) o << " shared"; + if (curr->hasMax()) o << ' ' << curr->max; + if (curr->shared) o << ")"; o << ")"; } void visitMemory(Memory* curr) { -- cgit v1.2.3