diff options
author | Abbas Mashayekh <martianboy2005@gmail.com> | 2021-02-10 01:17:28 +0330 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-09 13:47:28 -0800 |
commit | 3da8b08ecd57f5662bebc69ea73bf59e1928341e (patch) | |
tree | 2902eedc161579eaf37a1aed463de95916eee703 /src/passes/ReorderFunctions.cpp | |
parent | a12a8250da24aa5b5787bf89562b243fdc514302 (diff) | |
download | binaryen-3da8b08ecd57f5662bebc69ea73bf59e1928341e.tar.gz binaryen-3da8b08ecd57f5662bebc69ea73bf59e1928341e.tar.bz2 binaryen-3da8b08ecd57f5662bebc69ea73bf59e1928341e.zip |
[reference-types] remove single table restriction in IR (#3517)
Adds support for modules with multiple tables. Adds a field for the table name to `CallIndirect` and updates the C/JS APIs accordingly.
Diffstat (limited to 'src/passes/ReorderFunctions.cpp')
-rw-r--r-- | src/passes/ReorderFunctions.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/passes/ReorderFunctions.cpp b/src/passes/ReorderFunctions.cpp index 05df8cbe7..4d02616f0 100644 --- a/src/passes/ReorderFunctions.cpp +++ b/src/passes/ReorderFunctions.cpp @@ -70,9 +70,11 @@ struct ReorderFunctions : public Pass { for (auto& curr : module->exports) { counts[curr->value]++; } - for (auto& segment : module->table.segments) { - for (auto& curr : segment.data) { - counts[curr]++; + for (auto& table : module->tables) { + for (auto& segment : table->segments) { + for (auto& curr : segment.data) { + counts[curr]++; + } } } // sort |