diff options
author | Heejin Ahn <aheejin@gmail.com> | 2019-05-28 15:55:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-28 15:55:32 -0700 |
commit | 4b05489435a8f7c4a149db16a11f6c82ce63d622 (patch) | |
tree | 2963efafe4182f64b085bc32ce67b7a177049437 | |
parent | 4b223a33d9f44b99a783cb63329facea7edfb783 (diff) | |
download | binaryen-4b05489435a8f7c4a149db16a11f6c82ce63d622.tar.gz binaryen-4b05489435a8f7c4a149db16a11f6c82ce63d622.tar.bz2 binaryen-4b05489435a8f7c4a149db16a11f6c82ce63d622.zip |
Simplify function lists in RemoveUnusedModuleElements (NFC) (#2147)
It looks there's no need to maintain `functions` and `functionImports`
separately.
-rw-r--r-- | src/passes/RemoveUnusedModuleElements.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/passes/RemoveUnusedModuleElements.cpp b/src/passes/RemoveUnusedModuleElements.cpp index ec9753367..c96ce1a8c 100644 --- a/src/passes/RemoveUnusedModuleElements.cpp +++ b/src/passes/RemoveUnusedModuleElements.cpp @@ -120,17 +120,12 @@ struct ReachabilityAnalyzer : public PostWalker<ReachabilityAnalyzer> { // Finds function type usage struct FunctionTypeAnalyzer : public PostWalker<FunctionTypeAnalyzer> { - std::vector<Function*> functionImports; std::vector<Function*> functions; std::vector<CallIndirect*> indirectCalls; void visitFunction(Function* curr) { if (curr->type.is()) { - if (curr->imported()) { - functionImports.push_back(curr); - } else { - functions.push_back(curr); - } + functions.push_back(curr); } } @@ -271,9 +266,6 @@ struct RemoveUnusedModuleElements : public Pass { } }; // canonicalize all uses of function types - for (auto* import : analyzer.functionImports) { - import->type = canonicalize(import->type); - } for (auto* func : analyzer.functions) { func->type = canonicalize(func->type); } |