summaryrefslogtreecommitdiff
path: root/src/passes
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2017-09-22 12:52:35 -0700
committerGitHub <noreply@github.com>2017-09-22 12:52:35 -0700
commitdb66e646df6512d4eb2be344778001c62402e4c5 (patch)
treebcc070601de788d6ffa407164f2ce00ac3bab128 /src/passes
parentb29158db92c6fdab578b8b550cb965b020901768 (diff)
downloadbinaryen-db66e646df6512d4eb2be344778001c62402e4c5.tar.gz
binaryen-db66e646df6512d4eb2be344778001c62402e4c5.tar.bz2
binaryen-db66e646df6512d4eb2be344778001c62402e4c5.zip
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))
Diffstat (limited to 'src/passes')
-rw-r--r--src/passes/Print.cpp7
1 files changed, 4 insertions, 3 deletions
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<PrintSExpression> {
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<PrintSExpression> {
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) {