summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2020-03-05 15:52:44 -0800
committerGitHub <noreply@github.com>2020-03-05 15:52:44 -0800
commit9e3dbb1f668a14341e9aebae479537d4a26095a5 (patch)
tree9857d50c3373c3f6320ca3f2586bd499bc40b224 /src/wasm.h
parent3a275d0627da443cce93631a64d78e7b3f441416 (diff)
downloadbinaryen-9e3dbb1f668a14341e9aebae479537d4a26095a5.tar.gz
binaryen-9e3dbb1f668a14341e9aebae479537d4a26095a5.tar.bz2
binaryen-9e3dbb1f668a14341e9aebae479537d4a26095a5.zip
Initial multivalue support (#2675)
Implements parsing and emitting of tuple creation and extraction and tuple-typed control flow for both the text and binary formats. TODO: - Extend Precompute/interpreter to handle tuple values - C and JS API support/testing - Figure out how to lower in stack IR - Fuzzing
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 29844d855..507ffc047 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -538,6 +538,8 @@ public:
ThrowId,
RethrowId,
BrOnExnId,
+ TupleMakeId,
+ TupleExtractId,
NumExpressionIds
};
Id _id;
@@ -1149,6 +1151,25 @@ public:
void finalize();
};
+class TupleMake : public SpecificExpression<Expression::TupleMakeId> {
+public:
+ TupleMake(MixedArena& allocator) : operands(allocator) {}
+
+ ExpressionList operands;
+
+ void finalize();
+};
+
+class TupleExtract : public SpecificExpression<Expression::TupleExtractId> {
+public:
+ TupleExtract(MixedArena& allocator) {}
+
+ Expression* tuple;
+ Index index;
+
+ void finalize();
+};
+
// Globals
struct Importable {