summaryrefslogtreecommitdiff
path: root/src/wasm-type.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2023-10-17 10:12:02 -0700
committerGitHub <noreply@github.com>2023-10-17 17:12:02 +0000
commit2bf3caae764689c606ae38353b1bad5fe28bf5bb (patch)
tree7112801575e46132fdccad7bf120f5cafb9471da /src/wasm-type.h
parentb816ac563de6b1c53087796335fce593a96f569a (diff)
downloadbinaryen-2bf3caae764689c606ae38353b1bad5fe28bf5bb.tar.gz
binaryen-2bf3caae764689c606ae38353b1bad5fe28bf5bb.tar.bz2
binaryen-2bf3caae764689c606ae38353b1bad5fe28bf5bb.zip
Add getGeneralSuperType() that includes basic supers, and use in fuzzer (#6005)
With this, the fuzzer can replace e.g. an eq expression with a specific struct type, because now it is away that struct types have eq as their ancestor.
Diffstat (limited to 'src/wasm-type.h')
-rw-r--r--src/wasm-type.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wasm-type.h b/src/wasm-type.h
index bc6b25b34..23ceb9143 100644
--- a/src/wasm-type.h
+++ b/src/wasm-type.h
@@ -372,6 +372,11 @@ public:
// module) nominal supertype, return it, else an empty optional.
std::optional<HeapType> getDeclaredSuperType() const;
+ // As |getDeclaredSuperType|, but also handles basic types, that is, if the
+ // super is a basic type, then we return it here. Declared types are returned
+ // as well, just like |getDeclaredSuperType|.
+ std::optional<HeapType> getSuperType() const;
+
// Return the depth of this heap type in the nominal type hierarchy, i.e. the
// number of supertypes in its supertype chain.
size_t getDepth() const;