diff options
author | Max Graey <maxgraey@gmail.com> | 2021-10-07 22:43:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-07 12:43:30 -0700 |
commit | 2dff27c086e8f2a9913096ebf3dc93e97051d85a (patch) | |
tree | 3d689a659ad2339639fc4b2e73753b51e6d9295c /src/binaryen-c.h | |
parent | ff68bca64cd669aff59c7e1cc0a6677d267a410f (diff) | |
download | binaryen-2dff27c086e8f2a9913096ebf3dc93e97051d85a.tar.gz binaryen-2dff27c086e8f2a9913096ebf3dc93e97051d85a.tar.bz2 binaryen-2dff27c086e8f2a9913096ebf3dc93e97051d85a.zip |
Add table.set operation (#4215)
Diffstat (limited to 'src/binaryen-c.h')
-rw-r--r-- | src/binaryen-c.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/binaryen-c.h b/src/binaryen-c.h index f9c8719dd..d9e1afc8e 100644 --- a/src/binaryen-c.h +++ b/src/binaryen-c.h @@ -851,6 +851,15 @@ BINARYEN_API BinaryenExpressionRef BinaryenRefFunc(BinaryenModuleRef module, BINARYEN_API BinaryenExpressionRef BinaryenRefEq(BinaryenModuleRef module, BinaryenExpressionRef left, BinaryenExpressionRef right); +BINARYEN_API BinaryenExpressionRef BinaryenTableGet(BinaryenModuleRef module, + const char* name, + BinaryenExpressionRef index, + BinaryenType type); +BINARYEN_API BinaryenExpressionRef +BinaryenTableSet(BinaryenModuleRef module, + const char* name, + BinaryenExpressionRef index, + BinaryenExpressionRef value); // Try: name can be NULL. delegateTarget should be NULL in try-catch. BINARYEN_API BinaryenExpressionRef BinaryenTry(BinaryenModuleRef module, @@ -1195,6 +1204,40 @@ BinaryenGlobalSetGetValue(BinaryenExpressionRef expr); BINARYEN_API void BinaryenGlobalSetSetValue(BinaryenExpressionRef expr, BinaryenExpressionRef valueExpr); +// TableGet + +// Gets the name of the table being accessed by a `table.get` expression. +BINARYEN_API const char* BinaryenTableGetGetTable(BinaryenExpressionRef expr); +// Sets the name of the table being accessed by a `table.get` expression. +BINARYEN_API void BinaryenTableGetSetTable(BinaryenExpressionRef expr, + const char* table); +// Gets the index expression of a `table.get` expression. +BINARYEN_API BinaryenExpressionRef +BinaryenTableGetGetIndex(BinaryenExpressionRef expr); +// Sets the index expression of a `table.get` expression. +BINARYEN_API void BinaryenTableGetSetIndex(BinaryenExpressionRef expr, + BinaryenExpressionRef indexExpr); + +// TableSet + +// Gets the name of the table being accessed by a `table.set` expression. +BINARYEN_API const char* BinaryenTableSetGetTable(BinaryenExpressionRef expr); +// Sets the name of the table being accessed by a `table.set` expression. +BINARYEN_API void BinaryenTableSetSetTable(BinaryenExpressionRef expr, + const char* table); +// Gets the index expression of a `table.set` expression. +BINARYEN_API BinaryenExpressionRef +BinaryenTableSetGetIndex(BinaryenExpressionRef expr); +// Sets the index expression of a `table.set` expression. +BINARYEN_API void BinaryenTableSetSetIndex(BinaryenExpressionRef expr, + BinaryenExpressionRef indexExpr); +// Gets the value expression of a `table.set` expression. +BINARYEN_API BinaryenExpressionRef +BinaryenTableSetGetValue(BinaryenExpressionRef expr); +// Sets the value expression of a `table.set` expression. +BINARYEN_API void BinaryenTableSetSetValue(BinaryenExpressionRef expr, + BinaryenExpressionRef valueExpr); + // MemoryGrow // Gets the delta of a `memory.grow` expression. @@ -2625,6 +2668,8 @@ BINARYEN_API BinaryenSideEffects BinaryenSideEffectReadsGlobal(void); BINARYEN_API BinaryenSideEffects BinaryenSideEffectWritesGlobal(void); BINARYEN_API BinaryenSideEffects BinaryenSideEffectReadsMemory(void); BINARYEN_API BinaryenSideEffects BinaryenSideEffectWritesMemory(void); +BINARYEN_API BinaryenSideEffects BinaryenSideEffectReadsTable(void); +BINARYEN_API BinaryenSideEffects BinaryenSideEffectWritesTable(void); BINARYEN_API BinaryenSideEffects BinaryenSideEffectImplicitTrap(void); BINARYEN_API BinaryenSideEffects BinaryenSideEffectTrapsNeverHappen(void); BINARYEN_API BinaryenSideEffects BinaryenSideEffectIsAtomic(void); |