summaryrefslogtreecommitdiff
path: root/src/ir/utils.h
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-05-21 13:25:14 -0700
committerGitHub <noreply@github.com>2019-05-21 13:25:14 -0700
commit1a3c1a58cc7e97a846f612baf7f74a370980458f (patch)
treecbe62ea58b2c0dd6d98225265419fea0b829aeab /src/ir/utils.h
parentd78be9ac6c02910bbf8ac71118e68adff4fdc570 (diff)
downloadbinaryen-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/ir/utils.h')
-rw-r--r--src/ir/utils.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ir/utils.h b/src/ir/utils.h
index 4e941b8d0..a8af3ed18 100644
--- a/src/ir/utils.h
+++ b/src/ir/utils.h
@@ -118,10 +118,10 @@ struct ReFinalize
void visitSwitch(Switch* curr);
void visitCall(Call* curr);
void visitCallIndirect(CallIndirect* curr);
- void visitGetLocal(GetLocal* curr);
- void visitSetLocal(SetLocal* curr);
- void visitGetGlobal(GetGlobal* curr);
- void visitSetGlobal(SetGlobal* curr);
+ void visitLocalGet(LocalGet* curr);
+ void visitLocalSet(LocalSet* curr);
+ void visitGlobalGet(GlobalGet* curr);
+ void visitGlobalSet(GlobalSet* curr);
void visitLoad(Load* curr);
void visitStore(Store* curr);
void visitAtomicRMW(AtomicRMW* curr);
@@ -174,10 +174,10 @@ struct ReFinalizeNode : public OverriddenVisitor<ReFinalizeNode> {
void visitSwitch(Switch* curr) { curr->finalize(); }
void visitCall(Call* curr) { curr->finalize(); }
void visitCallIndirect(CallIndirect* curr) { curr->finalize(); }
- void visitGetLocal(GetLocal* curr) { curr->finalize(); }
- void visitSetLocal(SetLocal* curr) { curr->finalize(); }
- void visitGetGlobal(GetGlobal* curr) { curr->finalize(); }
- void visitSetGlobal(SetGlobal* curr) { curr->finalize(); }
+ void visitLocalGet(LocalGet* curr) { curr->finalize(); }
+ void visitLocalSet(LocalSet* curr) { curr->finalize(); }
+ void visitGlobalGet(GlobalGet* curr) { curr->finalize(); }
+ void visitGlobalSet(GlobalSet* curr) { curr->finalize(); }
void visitLoad(Load* curr) { curr->finalize(); }
void visitStore(Store* curr) { curr->finalize(); }
void visitAtomicRMW(AtomicRMW* curr) { curr->finalize(); }
@@ -302,19 +302,19 @@ struct I64Utilities {
static Expression* recreateI64(Builder& builder, Index low, Index high) {
return recreateI64(
- builder, builder.makeGetLocal(low, i32), builder.makeGetLocal(high, i32));
+ builder, builder.makeLocalGet(low, i32), builder.makeLocalGet(high, i32));
};
static Expression* getI64High(Builder& builder, Index index) {
return builder.makeUnary(
WrapInt64,
builder.makeBinary(ShrUInt64,
- builder.makeGetLocal(index, i64),
+ builder.makeLocalGet(index, i64),
builder.makeConst(Literal(int64_t(32)))));
}
static Expression* getI64Low(Builder& builder, Index index) {
- return builder.makeUnary(WrapInt64, builder.makeGetLocal(index, i64));
+ return builder.makeUnary(WrapInt64, builder.makeLocalGet(index, i64));
}
};