diff options
author | Heejin Ahn <aheejin@gmail.com> | 2019-05-21 13:25:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-21 13:25:14 -0700 |
commit | 1a3c1a58cc7e97a846f612baf7f74a370980458f (patch) | |
tree | cbe62ea58b2c0dd6d98225265419fea0b829aeab /src/binaryen-c.h | |
parent | d78be9ac6c02910bbf8ac71118e68adff4fdc570 (diff) | |
download | binaryen-1a3c1a58cc7e97a846f612baf7f74a370980458f.tar.gz binaryen-1a3c1a58cc7e97a846f612baf7f74a370980458f.tar.bz2 binaryen-1a3c1a58cc7e97a846f612baf7f74a370980458f.zip |
Reflect instruction renaming in code (#2128)
- Reflected new renamed instruction names in code and tests:
- `get_local` -> `local.get`
- `set_local` -> `local.set`
- `tee_local` -> `local.tee`
- `get_global` -> `global.get`
- `set_global` -> `global.set`
- `current_memory` -> `memory.size`
- `grow_memory` -> `memory.grow`
- Removed APIs related to old instruction names in Binaryen.js and added
APIs with new names if they are missing.
- Renamed `typedef SortedVector LocalSet` to `SetsOfLocals` to prevent
name clashes.
- Resolved several TODO renaming items in wasm-binary.h:
- `TableSwitch` -> `BrTable`
- `I32ConvertI64` -> `I32WrapI64`
- `I64STruncI32` -> `I64SExtendI32`
- `I64UTruncI32` -> `I64UExtendI32`
- `F32ConvertF64` -> `F32DemoteI64`
- `F64ConvertF32` -> `F64PromoteF32`
- Renamed `BinaryenGetFeatures` and `BinaryenSetFeatures` to
`BinaryenModuleGetFeatures` and `BinaryenModuleSetFeatures` for
consistency.
Diffstat (limited to 'src/binaryen-c.h')
-rw-r--r-- | src/binaryen-c.h | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/binaryen-c.h b/src/binaryen-c.h index 19434692b..e287e2541 100644 --- a/src/binaryen-c.h +++ b/src/binaryen-c.h @@ -99,10 +99,10 @@ BinaryenExpressionId BinaryenBreakId(void); BinaryenExpressionId BinaryenSwitchId(void); BinaryenExpressionId BinaryenCallId(void); BinaryenExpressionId BinaryenCallIndirectId(void); -BinaryenExpressionId BinaryenGetLocalId(void); -BinaryenExpressionId BinaryenSetLocalId(void); -BinaryenExpressionId BinaryenGetGlobalId(void); -BinaryenExpressionId BinaryenSetGlobalId(void); +BinaryenExpressionId BinaryenLocalGetId(void); +BinaryenExpressionId BinaryenLocalSetId(void); +BinaryenExpressionId BinaryenGlobalGetId(void); +BinaryenExpressionId BinaryenGlobalSetId(void); BinaryenExpressionId BinaryenLoadId(void); BinaryenExpressionId BinaryenStoreId(void); BinaryenExpressionId BinaryenConstId(void); @@ -345,8 +345,8 @@ BinaryenOp BinaryenLtFloat64(void); BinaryenOp BinaryenLeFloat64(void); BinaryenOp BinaryenGtFloat64(void); BinaryenOp BinaryenGeFloat64(void); -BinaryenOp BinaryenCurrentMemory(void); -BinaryenOp BinaryenGrowMemory(void); +BinaryenOp BinaryenMemorySize(void); +BinaryenOp BinaryenMemoryGrow(void); BinaryenOp BinaryenAtomicRMWAdd(void); BinaryenOp BinaryenAtomicRMWSub(void); BinaryenOp BinaryenAtomicRMWAnd(void); @@ -542,33 +542,33 @@ BinaryenExpressionRef BinaryenCallIndirect(BinaryenModuleRef module, BinaryenExpressionRef* operands, BinaryenIndex numOperands, const char* type); -// GetLocal: Note the 'type' parameter. It might seem redundant, since the +// LocalGet: Note the 'type' parameter. It might seem redundant, since the // local at that index must have a type. However, this API lets you // build code "top-down": create a node, then its parents, and so // on, and finally create the function at the end. (Note that in fact // you do not mention a function when creating ExpressionRefs, only -// a module.) And since GetLocal is a leaf node, we need to be told +// a module.) And since LocalGet is a leaf node, we need to be told // its type. (Other nodes detect their type either from their // type or their opcode, or failing that, their children. But -// GetLocal has no children, it is where a "stream" of type info +// LocalGet has no children, it is where a "stream" of type info // begins.) // Note also that the index of a local can refer to a param or // a var, that is, either a parameter to the function or a variable // declared when you call BinaryenAddFunction. See BinaryenAddFunction // for more details. -BinaryenExpressionRef BinaryenGetLocal(BinaryenModuleRef module, +BinaryenExpressionRef BinaryenLocalGet(BinaryenModuleRef module, BinaryenIndex index, BinaryenType type); -BinaryenExpressionRef BinaryenSetLocal(BinaryenModuleRef module, +BinaryenExpressionRef BinaryenLocalSet(BinaryenModuleRef module, BinaryenIndex index, BinaryenExpressionRef value); -BinaryenExpressionRef BinaryenTeeLocal(BinaryenModuleRef module, +BinaryenExpressionRef BinaryenLocalTee(BinaryenModuleRef module, BinaryenIndex index, BinaryenExpressionRef value); -BinaryenExpressionRef BinaryenGetGlobal(BinaryenModuleRef module, +BinaryenExpressionRef BinaryenGlobalGet(BinaryenModuleRef module, const char* name, BinaryenType type); -BinaryenExpressionRef BinaryenSetGlobal(BinaryenModuleRef module, +BinaryenExpressionRef BinaryenGlobalSet(BinaryenModuleRef module, const char* name, BinaryenExpressionRef value); // Load: align can be 0, in which case it will be the natural alignment (equal @@ -722,16 +722,16 @@ BinaryenIndex BinaryenCallIndirectGetNumOperands(BinaryenExpressionRef expr); BinaryenExpressionRef BinaryenCallIndirectGetOperand(BinaryenExpressionRef expr, BinaryenIndex index); -BinaryenIndex BinaryenGetLocalGetIndex(BinaryenExpressionRef expr); +BinaryenIndex BinaryenLocalGetGetIndex(BinaryenExpressionRef expr); -int BinaryenSetLocalIsTee(BinaryenExpressionRef expr); -BinaryenIndex BinaryenSetLocalGetIndex(BinaryenExpressionRef expr); -BinaryenExpressionRef BinaryenSetLocalGetValue(BinaryenExpressionRef expr); +int BinaryenLocalSetIsTee(BinaryenExpressionRef expr); +BinaryenIndex BinaryenLocalSetGetIndex(BinaryenExpressionRef expr); +BinaryenExpressionRef BinaryenLocalSetGetValue(BinaryenExpressionRef expr); -const char* BinaryenGetGlobalGetName(BinaryenExpressionRef expr); +const char* BinaryenGlobalGetGetName(BinaryenExpressionRef expr); -const char* BinaryenSetGlobalGetName(BinaryenExpressionRef expr); -BinaryenExpressionRef BinaryenSetGlobalGetValue(BinaryenExpressionRef expr); +const char* BinaryenGlobalSetGetName(BinaryenExpressionRef expr); +BinaryenExpressionRef BinaryenGlobalSetGetValue(BinaryenExpressionRef expr); BinaryenOp BinaryenHostGetOp(BinaryenExpressionRef expr); const char* BinaryenHostGetNameOperand(BinaryenExpressionRef expr); @@ -945,8 +945,9 @@ void BinaryenSetStart(BinaryenModuleRef module, BinaryenFunctionRef start); // Features // These control what features are allowed when validation and in passes. -BinaryenFeatures BinaryenGetFeatures(BinaryenModuleRef module); -void BinaryenSetFeatures(BinaryenModuleRef module, BinaryenFeatures features); +BinaryenFeatures BinaryenModuleGetFeatures(BinaryenModuleRef module); +void BinaryenModuleSetFeatures(BinaryenModuleRef module, + BinaryenFeatures features); // // ========== Module Operations ========== |