summaryrefslogtreecommitdiff
path: root/src/ir/module-utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/module-utils.cpp')
-rw-r--r--src/ir/module-utils.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/ir/module-utils.cpp b/src/ir/module-utils.cpp
index 38bb6f3d9..33f8ac926 100644
--- a/src/ir/module-utils.cpp
+++ b/src/ir/module-utils.cpp
@@ -55,8 +55,6 @@ struct CodeScanner
counts.note(call->heapType);
} else if (curr->is<RefNull>()) {
counts.note(curr->type);
- } else if (curr->is<RttCanon>() || curr->is<RttSub>()) {
- counts.note(curr->type.getRtt().heapType);
} else if (auto* make = curr->dynCast<StructNew>()) {
handleMake(make);
} else if (auto* make = curr->dynCast<ArrayNew>()) {
@@ -64,12 +62,12 @@ struct CodeScanner
} else if (auto* make = curr->dynCast<ArrayInit>()) {
handleMake(make);
} else if (auto* cast = curr->dynCast<RefCast>()) {
- handleCast(cast);
+ counts.note(cast->intendedType);
} else if (auto* cast = curr->dynCast<RefTest>()) {
- handleCast(cast);
+ counts.note(cast->intendedType);
} else if (auto* cast = curr->dynCast<BrOn>()) {
if (cast->op == BrOnCast || cast->op == BrOnCastFail) {
- handleCast(cast);
+ counts.note(cast->intendedType);
}
} else if (auto* get = curr->dynCast<StructGet>()) {
counts.note(get->ref->type);
@@ -86,18 +84,10 @@ struct CodeScanner
}
template<typename T> void handleMake(T* curr) {
- if (!curr->rtt && curr->type != Type::unreachable) {
+ if (curr->type != Type::unreachable) {
counts.note(curr->type.getHeapType());
}
}
-
- template<typename T> void handleCast(T* curr) {
- // Some operations emit a HeapType in the binary format, if they are
- // static and not dynamic (if dynamic, the RTT provides the heap type).
- if (!curr->rtt) {
- counts.note(curr->intendedType);
- }
- }
};
Counts getHeapTypeCounts(Module& wasm) {