diff options
Diffstat (limited to 'src/passes/DeadArgumentElimination.cpp')
-rw-r--r-- | src/passes/DeadArgumentElimination.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/passes/DeadArgumentElimination.cpp b/src/passes/DeadArgumentElimination.cpp index c4de07d81..975b291b0 100644 --- a/src/passes/DeadArgumentElimination.cpp +++ b/src/passes/DeadArgumentElimination.cpp @@ -279,16 +279,15 @@ struct DAE : public Pass { for (auto& func : module->functions) { infoMap[func->name]; } - // Check the influence of the table and exports. + DAEScanner scanner(&infoMap); + scanner.walkModuleCode(module); for (auto& curr : module->exports) { if (curr->kind == ExternalKind::Function) { infoMap[curr->value].hasUnseenCalls = true; } } - ElementUtils::iterAllElementFunctionNames( - module, [&](Name name) { infoMap[name].hasUnseenCalls = true; }); // Scan all the functions. - DAEScanner(&infoMap).run(runner, module); + scanner.run(runner, module); // Combine all the info. std::unordered_map<Name, std::vector<Call*>> allCalls; std::unordered_set<Name> tailCallees; |