From 443c0069df34bac9640ed75e396c8b76d3870ae0 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Wed, 24 Jul 2019 23:57:04 -0700 Subject: More push/pop support (#2260) This adds - `push`/`pop` support for other types: v128 and exnref - `push`/`pop` support for binaryen.js Because binaryen.js follows Binaryen's AST structure, without `pop` in binaryen.js, EH instructions cannot be represented in binaryen.js. --- src/binaryen-c.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/binaryen-c.h') diff --git a/src/binaryen-c.h b/src/binaryen-c.h index db49c45c9..dc5d50fef 100644 --- a/src/binaryen-c.h +++ b/src/binaryen-c.h @@ -127,6 +127,8 @@ BinaryenExpressionId BinaryenMemoryInitId(void); BinaryenExpressionId BinaryenDataDropId(void); BinaryenExpressionId BinaryenMemoryCopyId(void); BinaryenExpressionId BinaryenMemoryFillId(void); +BinaryenExpressionId BinaryenPushId(void); +BinaryenExpressionId BinaryenPopId(void); // External kinds (call to get the value of each; you can cache them) @@ -699,6 +701,9 @@ BinaryenExpressionRef BinaryenMemoryFill(BinaryenModuleRef module, BinaryenExpressionRef dest, BinaryenExpressionRef value, BinaryenExpressionRef size); +BinaryenExpressionRef BinaryenPush(BinaryenModuleRef module, + BinaryenExpressionRef value); +BinaryenExpressionRef BinaryenPop(BinaryenModuleRef module, BinaryenType type); BinaryenExpressionId BinaryenExpressionGetId(BinaryenExpressionRef expr); BinaryenType BinaryenExpressionGetType(BinaryenExpressionRef expr); @@ -850,6 +855,8 @@ BinaryenExpressionRef BinaryenMemoryFillGetDest(BinaryenExpressionRef expr); BinaryenExpressionRef BinaryenMemoryFillGetValue(BinaryenExpressionRef expr); BinaryenExpressionRef BinaryenMemoryFillGetSize(BinaryenExpressionRef expr); +BinaryenExpressionRef BinaryenPushGetValue(BinaryenExpressionRef expr); + // Functions typedef void* BinaryenFunctionRef; -- cgit v1.2.3