summaryrefslogtreecommitdiff
path: root/src/wasm
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm')
-rw-r--r--src/wasm/wasm-type.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp
index af382da23..7801cc289 100644
--- a/src/wasm/wasm-type.cpp
+++ b/src/wasm/wasm-type.cpp
@@ -1082,13 +1082,13 @@ Type Type::getLeastUpperBound(Type a, Type b) {
return TypeBounder().getLeastUpperBound(a, b);
}
-Type::Iterator Type::end() const {
+size_t Type::size() const {
if (isTuple()) {
- return Iterator(this, getTypeInfo(*this)->tuple.types.size());
+ return getTypeInfo(*this)->tuple.types.size();
} else {
// TODO: unreachable is special and expands to {unreachable} currently.
// see also: https://github.com/WebAssembly/binaryen/issues/3062
- return Iterator(this, size_t(id != Type::none));
+ return size_t(id != Type::none);
}
}
@@ -1096,21 +1096,12 @@ const Type& Type::Iterator::operator*() const {
if (parent->isTuple()) {
return getTypeInfo(*parent)->tuple.types[index];
} else {
- // TODO: see comment in Type::end()
+ // TODO: see comment in Type::size()
assert(index == 0 && parent->id != Type::none && "Index out of bounds");
return *parent;
}
}
-const Type& Type::operator[](size_t index) const {
- if (isTuple()) {
- return getTypeInfo(*this)->tuple.types[index];
- } else {
- assert(index == 0 && "Index out of bounds");
- return *begin();
- }
-}
-
HeapType::HeapType(Signature sig) {
assert(!isTemp(sig.params) && "Leaking temporary type!");
assert(!isTemp(sig.results) && "Leaking temporary type!");