diff options
author | Max Graey <maxgraey@gmail.com> | 2021-10-09 05:26:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-08 19:26:08 -0700 |
commit | ef686a4d932b9b86edc34a3b9b15926f943f6f7b (patch) | |
tree | 38a89d5b555d4501b7d504a66c7aec409e45e9b1 /src/passes | |
parent | 53c5e3e62db25fe3522a1fa615a1f53c4cefdf06 (diff) | |
download | binaryen-ef686a4d932b9b86edc34a3b9b15926f943f6f7b.tar.gz binaryen-ef686a4d932b9b86edc34a3b9b15926f943f6f7b.tar.bz2 binaryen-ef686a4d932b9b86edc34a3b9b15926f943f6f7b.zip |
Add table.size operation (#4224)
Diffstat (limited to 'src/passes')
-rw-r--r-- | src/passes/Print.cpp | 4 | ||||
-rw-r--r-- | src/passes/RemoveUnusedModuleElements.cpp | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index bea704b1d..abea90117 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -1852,6 +1852,10 @@ struct PrintExpressionContents printMedium(o, "table.set "); printName(curr->table, o); } + void visitTableSize(TableSize* curr) { + printMedium(o, "table.size "); + printName(curr->table, o); + } void visitTry(Try* curr) { printMedium(o, "try"); if (curr->name.is()) { diff --git a/src/passes/RemoveUnusedModuleElements.cpp b/src/passes/RemoveUnusedModuleElements.cpp index 32db977ec..0f2c69e02 100644 --- a/src/passes/RemoveUnusedModuleElements.cpp +++ b/src/passes/RemoveUnusedModuleElements.cpp @@ -130,6 +130,7 @@ struct ReachabilityAnalyzer : public PostWalker<ReachabilityAnalyzer> { } void visitTableGet(TableGet* curr) { maybeAddTable(curr->table); } void visitTableSet(TableSet* curr) { maybeAddTable(curr->table); } + void visitTableSize(TableSize* curr) { maybeAddTable(curr->table); } void visitThrow(Throw* curr) { maybeAdd(ModuleElement(ModuleElementKind::Tag, curr->tag)); } |