summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/wasm.h b/src/wasm.h
index c1936cb46..0ea3ffeb7 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -1345,9 +1345,17 @@ public:
class StructNew : public SpecificExpression<Expression::StructNewId> {
public:
- StructNew(MixedArena& allocator) {}
+ StructNew(MixedArena& allocator) : operands(allocator) {}
- void finalize() { WASM_UNREACHABLE("TODO (gc): struct.new"); }
+ Expression* rtt;
+ // A struct.new_with_default has empty operands. This does leave the case of a
+ // struct with no fields ambiguous, but it doesn't make a difference in that
+ // case, and binaryen doesn't guarantee roundtripping binaries anyhow.
+ ExpressionList operands;
+
+ bool isWithDefault() { return operands.empty(); }
+
+ void finalize();
};
class StructGet : public SpecificExpression<Expression::StructGetId> {