summaryrefslogtreecommitdiff
path: root/src/ir/literal-utils.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2023-11-09 12:39:32 -0800
committerGitHub <noreply@github.com>2023-11-09 12:39:32 -0800
commitb8422c5c964fdbb1d4cb01181de121c30c0a2f70 (patch)
treee94dbf3ea910aacab44e5ea9c35dc4fed748cc2a /src/ir/literal-utils.h
parent536b066a5606657adb7eea7eb4da89d3cd58306b (diff)
downloadbinaryen-b8422c5c964fdbb1d4cb01181de121c30c0a2f70.tar.gz
binaryen-b8422c5c964fdbb1d4cb01181de121c30c0a2f70.tar.bz2
binaryen-b8422c5c964fdbb1d4cb01181de121c30c0a2f70.zip
[NFC] Simplify LiteralUtils::canMakeZero (#6093)
Diffstat (limited to 'src/ir/literal-utils.h')
-rw-r--r--src/ir/literal-utils.h14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/ir/literal-utils.h b/src/ir/literal-utils.h
index 0131ecdc9..58f8fe8fe 100644
--- a/src/ir/literal-utils.h
+++ b/src/ir/literal-utils.h
@@ -29,19 +29,7 @@ inline Expression* makeFromInt32(int32_t x, Type type, Module& wasm) {
return ret;
}
-inline bool canMakeZero(Type type) {
- if (type.isNonNullable()) {
- return false;
- }
- if (type.isTuple()) {
- for (auto t : type) {
- if (t.isNonNullable()) {
- return false;
- }
- }
- }
- return true;
-}
+inline bool canMakeZero(Type type) { return type.isDefaultable(); }
inline Expression* makeZero(Type type, Module& wasm) {
assert(canMakeZero(type));