summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-10-24 12:34:29 -0700
committerGitHub <noreply@github.com>2022-10-24 12:34:29 -0700
commit5245b8cdf64dad2e2b7c19b08fe22d2e6039ffa7 (patch)
treece2654a9e1af7eb9813a70471e32e72adcc11ab7 /src
parent3986d95de1f3d91e4ec2193bc70c6c4b4fdbd1bd (diff)
downloadbinaryen-5245b8cdf64dad2e2b7c19b08fe22d2e6039ffa7.tar.gz
binaryen-5245b8cdf64dad2e2b7c19b08fe22d2e6039ffa7.tar.bz2
binaryen-5245b8cdf64dad2e2b7c19b08fe22d2e6039ffa7.zip
[NFC] Remove an ancient hack in ReFinalize (#5183)
Poking in the git history, this was some kind of hack for a problem that appears to no longer exist since at least 5 years ago. Logically, refinalize should never change a type from unreachable to none, or at least if we have a place that does this, we should manually do the necessary things around that, like updating the function's return type. The opposite, none (or anything else) to unreachable is the common case, where we use refinalize to propagate that type upwards. Fuzzing also finds no issues.
Diffstat (limited to 'src')
-rw-r--r--src/ir/ReFinalize.cpp9
-rw-r--r--src/ir/utils.h2
2 files changed, 0 insertions, 11 deletions
diff --git a/src/ir/ReFinalize.cpp b/src/ir/ReFinalize.cpp
index 3a5e4172d..1e77630ab 100644
--- a/src/ir/ReFinalize.cpp
+++ b/src/ir/ReFinalize.cpp
@@ -188,15 +188,6 @@ void ReFinalize::visitStringSliceIter(StringSliceIter* curr) {
curr->finalize();
}
-void ReFinalize::visitFunction(Function* curr) {
- // we may have changed the body from unreachable to none, which might be bad
- // if the function has a return value
- if (curr->getResults() != Type::none && curr->body->type == Type::none) {
- Builder builder(*getModule());
- curr->body = builder.blockify(curr->body, builder.makeUnreachable());
- }
-}
-
void ReFinalize::visitExport(Export* curr) { WASM_UNREACHABLE("unimp"); }
void ReFinalize::visitGlobal(Global* curr) { WASM_UNREACHABLE("unimp"); }
void ReFinalize::visitTable(Table* curr) { WASM_UNREACHABLE("unimp"); }
diff --git a/src/ir/utils.h b/src/ir/utils.h
index 4f4e5657b..72aa701bb 100644
--- a/src/ir/utils.h
+++ b/src/ir/utils.h
@@ -138,8 +138,6 @@ struct ReFinalize
#include "wasm-delegations.def"
- void visitFunction(Function* curr);
-
void visitExport(Export* curr);
void visitGlobal(Global* curr);
void visitTable(Table* curr);