summaryrefslogtreecommitdiff
path: root/src/wasm
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm')
-rw-r--r--src/wasm/wasm-binary.cpp4
-rw-r--r--src/wasm/wasm-type.cpp12
2 files changed, 9 insertions, 7 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index b3108100f..2b96e839c 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -244,7 +244,7 @@ void WasmBinaryWriter::writeTypes() {
// be safe to treat as final, i.e. types without subtypes.
std::vector<bool> hasSubtypes(indexedTypes.types.size());
for (auto type : indexedTypes.types) {
- if (auto super = type.getSuperType()) {
+ if (auto super = type.getDeclaredSuperType()) {
hasSubtypes[indexedTypes.indices[*super]] = true;
}
}
@@ -264,7 +264,7 @@ void WasmBinaryWriter::writeTypes() {
lastGroup = currGroup;
// Emit the type definition.
BYN_TRACE("write " << type << std::endl);
- auto super = type.getSuperType();
+ auto super = type.getDeclaredSuperType();
if (super || type.isOpen()) {
if (type.isOpen()) {
o << S32LEB(BinaryConsts::EncodedType::Sub);
diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp
index 7f8cde318..1b8d7d0f1 100644
--- a/src/wasm/wasm-type.cpp
+++ b/src/wasm/wasm-type.cpp
@@ -906,7 +906,8 @@ FeatureSet Type::getFeatures() const {
}
if (heapType->isStruct() || heapType->isArray() ||
- heapType->getRecGroup().size() > 1 || heapType->getSuperType()) {
+ heapType->getRecGroup().size() > 1 ||
+ heapType->getDeclaredSuperType()) {
feats |= FeatureSet::ReferenceTypes | FeatureSet::GC;
} else if (heapType->isSignature()) {
// This is a function reference, which requires reference types and
@@ -1207,7 +1208,7 @@ Array HeapType::getArray() const {
return getHeapTypeInfo(*this)->array;
}
-std::optional<HeapType> HeapType::getSuperType() const {
+std::optional<HeapType> HeapType::getDeclaredSuperType() const {
if (isBasic()) {
return {};
}
@@ -1221,7 +1222,8 @@ std::optional<HeapType> HeapType::getSuperType() const {
size_t HeapType::getDepth() const {
size_t depth = 0;
std::optional<HeapType> super;
- for (auto curr = *this; (super = curr.getSuperType()); curr = *super) {
+ for (auto curr = *this; (super = curr.getDeclaredSuperType());
+ curr = *super) {
++depth;
}
// In addition to the explicit supertypes we just traversed over, there is
@@ -1344,7 +1346,7 @@ std::vector<HeapType> HeapType::getHeapTypeChildren() const {
std::vector<HeapType> HeapType::getReferencedHeapTypes() const {
auto types = getHeapTypeChildren();
- if (auto super = getSuperType()) {
+ if (auto super = getDeclaredSuperType()) {
types.push_back(*super);
}
return types;
@@ -1776,7 +1778,7 @@ std::ostream& TypePrinter::print(HeapType type) {
}
bool useSub = false;
- auto super = type.getSuperType();
+ auto super = type.getDeclaredSuperType();
if (super || type.isOpen()) {
useSub = true;
os << "(sub ";