diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/asm2wasm.h | 4 | ||||
-rw-r--r-- | src/wasm.h | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index 2d045401a..83f638310 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -597,7 +597,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { MappedGlobal global = mappedGlobals[name]; auto ret = allocator.alloc<Store>(); ret->bytes = getWasmTypeSize(global.type); - ret->float_ = isFloat(global.type); + ret->float_ = isWasmTypeFloat(global.type); ret->offset = 0; ret->align = ret->bytes; auto ptr = allocator.alloc<Const>(); @@ -676,7 +676,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { auto ret = allocator.alloc<Load>(); ret->bytes = getWasmTypeSize(global.type); ret->signed_ = true; // but doesn't matter - ret->float_ = isFloat(global.type); + ret->float_ = isWasmTypeFloat(global.type); ret->offset = 0; ret->align = ret->bytes; auto ptr = allocator.alloc<Const>(); diff --git a/src/wasm.h b/src/wasm.h index d4ecabca3..32c6466b8 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -16,7 +16,9 @@ namespace wasm { -// Basics +// We use a Name for all of the identifiers. These are IStrings, so they are +// all interned - comparisons etc are just pointer comparisons, so there is no +// perf loss. Having names everywhere makes using the AST much nicer. struct Name : public cashew::IString { Name() : cashew::IString() {} @@ -59,7 +61,7 @@ unsigned getWasmTypeSize(WasmType type) { } } -bool isFloat(WasmType type) { +bool isWasmTypeFloat(WasmType type) { switch (type) { case f32: case f64: return true; |