summaryrefslogtreecommitdiff
path: root/src/wasm-builder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-builder.h')
-rw-r--r--src/wasm-builder.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h
index 5bc238878..5cca8d959 100644
--- a/src/wasm-builder.h
+++ b/src/wasm-builder.h
@@ -709,15 +709,21 @@ public:
ret->finalize();
return ret;
}
- RttCanon* makeRttCanon() {
+ RttCanon* makeRttCanon(HeapType heapType) {
auto* ret = wasm.allocator.alloc<RttCanon>();
- WASM_UNREACHABLE("TODO (gc): rtt.canon");
+ ret->type = Type(Rtt(0, heapType));
ret->finalize();
return ret;
}
- RttSub* makeRttSub() {
+ RttSub* makeRttSub(HeapType heapType, Expression* parent) {
auto* ret = wasm.allocator.alloc<RttSub>();
- WASM_UNREACHABLE("TODO (gc): rtt.sub");
+ ret->parent = parent;
+ auto parentRtt = parent->type.getRtt();
+ if (parentRtt.hasDepth()) {
+ ret->type = Type(Rtt(parentRtt.depth + 1, heapType));
+ } else {
+ ret->type = Type(Rtt(heapType));
+ }
ret->finalize();
return ret;
}