diff options
Diffstat (limited to 'src/wasm')
-rw-r--r-- | src/wasm/wasm-type.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp index cab68d00d..dce0eb645 100644 --- a/src/wasm/wasm-type.cpp +++ b/src/wasm/wasm-type.cpp @@ -1386,6 +1386,20 @@ HeapType::BasicHeapType HeapType::getBottom() const { WASM_UNREACHABLE("unexpected kind"); } +HeapType::BasicHeapType HeapType::getTop() const { + switch (getBottom()) { + case none: + return any; + case nofunc: + return func; + case noext: + return ext; + default: + break; + } + WASM_UNREACHABLE("unexpected type"); +} + bool HeapType::isSubType(HeapType left, HeapType right) { // As an optimization, in the common case do not even construct a SubTyper. if (left == right) { |