summaryrefslogtreecommitdiff
path: root/src/ir/lubs.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-12-09 08:28:35 -0800
committerGitHub <noreply@github.com>2021-12-09 08:28:35 -0800
commit2689bc1233a6aee97ca04d5f60af0a8c663479c8 (patch)
treeaac86d3e4884e7ddb55235fcd5d6f37ddc0ed265 /src/ir/lubs.h
parentf7be757a71e5562afad898992574681d50a67dbf (diff)
downloadbinaryen-2689bc1233a6aee97ca04d5f60af0a8c663479c8.tar.gz
binaryen-2689bc1233a6aee97ca04d5f60af0a8c663479c8.tar.bz2
binaryen-2689bc1233a6aee97ca04d5f60af0a8c663479c8.zip
[NFC] Refactor result type LUB computation into a helper function (#4379)
Diffstat (limited to 'src/ir/lubs.h')
-rw-r--r--src/ir/lubs.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ir/lubs.h b/src/ir/lubs.h
index e03e693e0..05c6b07fd 100644
--- a/src/ir/lubs.h
+++ b/src/ir/lubs.h
@@ -128,6 +128,19 @@ private:
std::unordered_set<RefNull*> nulls;
};
+namespace LUB {
+
+// Given a function, computes a LUB for its results. The caller can then decide
+// to apply a refined type if we found one.
+//
+// This modifies the called function even if it fails to find a refined type as
+// it does a refinalize in order to be able to compute the new types. We could
+// roll back that change, but it's not harmful and can help, so we keep it
+// regardless.
+LUBFinder getResultsLUB(Function* func, Module& wasm);
+
+} // namespace LUB
+
} // namespace wasm
#endif // wasm_ir_lubs_h