diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-08-16 09:40:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-16 09:40:59 -0700 |
commit | e5e3bf39f25ed3a2fb45a9ca1f55d6828d81a3eb (patch) | |
tree | 834f67d6ebaf295af0e1d6789bc7f52d120dff33 /src/passes/RemoveUnusedFunctions.cpp | |
parent | e268d939b86d8639d014b8036e7664d66b6a32e9 (diff) | |
parent | 7851e3a7a3bea679f422116862c5801f1938806d (diff) | |
download | binaryen-e5e3bf39f25ed3a2fb45a9ca1f55d6828d81a3eb.tar.gz binaryen-e5e3bf39f25ed3a2fb45a9ca1f55d6828d81a3eb.tar.bz2 binaryen-e5e3bf39f25ed3a2fb45a9ca1f55d6828d81a3eb.zip |
Merge pull request #668 from WebAssembly/tables_n_memories
Tables and memories
Diffstat (limited to 'src/passes/RemoveUnusedFunctions.cpp')
-rw-r--r-- | src/passes/RemoveUnusedFunctions.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/passes/RemoveUnusedFunctions.cpp b/src/passes/RemoveUnusedFunctions.cpp index a2941aff6..78b0f0ffc 100644 --- a/src/passes/RemoveUnusedFunctions.cpp +++ b/src/passes/RemoveUnusedFunctions.cpp @@ -39,8 +39,10 @@ struct RemoveUnusedFunctions : public Pass { root.push_back(module->getFunction(curr->value)); } // For now, all functions that can be called indirectly are marked as roots. - for (auto& curr : module->table.names) { - root.push_back(module->getFunction(curr)); + for (auto& segment : module->table.segments) { + for (auto& curr : segment.data) { + root.push_back(module->getFunction(curr)); + } } // Compute function reachability starting from the root set. DirectCallGraphAnalyzer analyzer(module, root); |