From 1a3c1a58cc7e97a846f612baf7f74a370980458f Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Tue, 21 May 2019 13:25:14 -0700 Subject: 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. --- src/tools/wasm-ctor-eval.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tools/wasm-ctor-eval.cpp') diff --git a/src/tools/wasm-ctor-eval.cpp b/src/tools/wasm-ctor-eval.cpp index 293c675d1..af4d0d0b2 100644 --- a/src/tools/wasm-ctor-eval.cpp +++ b/src/tools/wasm-ctor-eval.cpp @@ -133,7 +133,7 @@ public: ModuleUtils::iterDefinedGlobals(wasm, [&](Global* global) { if (!global->init->is()) { // some constants are ok to use - if (auto* get = global->init->dynCast()) { + if (auto* get = global->init->dynCast()) { auto name = get->name; auto* import = wasm.getGlobal(name); if (import->module == Name(ENV) && @@ -228,7 +228,7 @@ struct CtorEvalExternalInterface : EvallingModuleInstance::ExternalInterface { // offset 0. if (auto* c = segment.offset->dynCast()) { start = c->value.getInteger(); - } else if (segment.offset->is()) { + } else if (segment.offset->is()) { start = 0; } else { WASM_UNREACHABLE(); // wasm spec only allows const and global.get there -- cgit v1.2.3