diff options
Diffstat (limited to 'src/wasm')
-rw-r--r-- | src/wasm/wasm-type.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp index 34d7e942f..e86843f10 100644 --- a/src/wasm/wasm-type.cpp +++ b/src/wasm/wasm-type.cpp @@ -922,6 +922,19 @@ unsigned Type::getByteSize() const { return getSingleByteSize(*this); } +unsigned Type::hasByteSize() const { + auto hasSingleByteSize = [](Type t) { return t.isNumber(); }; + if (isTuple()) { + for (const auto& t : *this) { + if (!hasSingleByteSize(t)) { + return false; + } + } + return true; + } + return hasSingleByteSize(*this); +} + Type Type::reinterpret() const { assert(!isTuple() && "Unexpected tuple type"); switch ((*begin()).getBasic()) { |