summaryrefslogtreecommitdiff
path: root/src/tools/wasm-reduce.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-10-19 14:54:38 -0700
committerGitHub <noreply@github.com>2020-10-19 14:54:38 -0700
commit8408cab1fdf67ce9ff331a131f06610909b78e61 (patch)
tree7804d682639f312d786f09292cee908ada248754 /src/tools/wasm-reduce.cpp
parent3f1b6ca3f3dc852aaa0a427b4db340e75c5bb693 (diff)
downloadbinaryen-8408cab1fdf67ce9ff331a131f06610909b78e61.tar.gz
binaryen-8408cab1fdf67ce9ff331a131f06610909b78e61.tar.bz2
binaryen-8408cab1fdf67ce9ff331a131f06610909b78e61.zip
wasm-reduce: When trying to remove a function, try to replace ref.func usages too (#3254)
Diffstat (limited to 'src/tools/wasm-reduce.cpp')
-rw-r--r--src/tools/wasm-reduce.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp
index bb2de0896..6b4483dd2 100644
--- a/src/tools/wasm-reduce.cpp
+++ b/src/tools/wasm-reduce.cpp
@@ -937,6 +937,11 @@ struct Reducer
replaceCurrent(Builder(*getModule()).replaceWithIdenticalType(curr));
}
}
+ void visitRefFunc(RefFunc* curr) {
+ if (names.count(curr->func)) {
+ replaceCurrent(Builder(*getModule()).replaceWithIdenticalType(curr));
+ }
+ }
void visitExport(Export* curr) {
if (names.count(curr->value)) {
exportsToRemove.push_back(curr->name);