summaryrefslogtreecommitdiff
path: root/src/wasm-delegations-fields.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-delegations-fields.h')
-rw-r--r--src/wasm-delegations-fields.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/wasm-delegations-fields.h b/src/wasm-delegations-fields.h
index 37fb60ef2..b5d80b86a 100644
--- a/src/wasm-delegations-fields.h
+++ b/src/wasm-delegations-fields.h
@@ -57,6 +57,10 @@
//
// DELEGATE_FIELD_NAME(id, name) - called for a Name.
//
+// DELEGATE_FIELD_NAME_VECTOR(id, name) - called for a variable-sized vector of
+// names (like try's catch event names). If this is not defined, and
+// DELEGATE_GET_FIELD is, then DELEGATE_FIELD_CHILD is called on them.
+//
// DELEGATE_FIELD_SCOPE_NAME_DEF(id, name) - called for a scope name definition
// (like a block's name).
//
@@ -124,6 +128,17 @@
#error please define DELEGATE_FIELD_NAME(id, name)
#endif
+#ifndef DELEGATE_FIELD_NAME_VECTOR
+#ifdef DELEGATE_GET_FIELD
+#define DELEGATE_FIELD_NAME_VECTOR(id, name) \
+ for (Index i = 0; i < (DELEGATE_GET_FIELD(id, name)).size(); i++) { \
+ DELEGATE_FIELD_NAME(id, name[i]); \
+ }
+#else
+#error please define DELEGATE_FIELD_NAME_VECTOR(id, name)
+#endif
+#endif
+
#ifndef DELEGATE_FIELD_SCOPE_NAME_DEF
#error please define DELEGATE_FIELD_SCOPE_NAME_DEF(id, name)
#endif
@@ -490,7 +505,8 @@ switch (DELEGATE_ID) {
}
case Expression::Id::TryId: {
DELEGATE_START(Try);
- DELEGATE_FIELD_CHILD(Try, catchBody);
+ DELEGATE_FIELD_CHILD_VECTOR(Try, catchBodies);
+ DELEGATE_FIELD_NAME_VECTOR(Try, catchEvents);
DELEGATE_FIELD_CHILD(Try, body);
DELEGATE_END(Try);
break;
@@ -504,7 +520,7 @@ switch (DELEGATE_ID) {
}
case Expression::Id::RethrowId: {
DELEGATE_START(Rethrow);
- DELEGATE_FIELD_CHILD(Rethrow, exnref);
+ DELEGATE_FIELD_INT(Rethrow, depth);
DELEGATE_END(Rethrow);
break;
}
@@ -665,6 +681,7 @@ switch (DELEGATE_ID) {
#undef DELEGATE_FIELD_INT_ARRAY
#undef DELEGATE_FIELD_LITERAL
#undef DELEGATE_FIELD_NAME
+#undef DELEGATE_FIELD_NAME_VECTOR
#undef DELEGATE_FIELD_SCOPE_NAME_DEF
#undef DELEGATE_FIELD_SCOPE_NAME_USE
#undef DELEGATE_FIELD_SCOPE_NAME_USE_VECTOR