From 113efcaa1e814304662ccc56312d8c59014a3a6c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 15 Aug 2016 14:29:57 -0700 Subject: offset support in table --- src/passes/RemoveUnusedFunctions.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/passes/RemoveUnusedFunctions.cpp') 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); -- cgit v1.2.3