diff options
Diffstat (limited to 'src/literal.h')
-rw-r--r-- | src/literal.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/literal.h b/src/literal.h index 560895e7a..c55d645ad 100644 --- a/src/literal.h +++ b/src/literal.h @@ -44,7 +44,7 @@ private: return val & (sizeof(T) * 8 - 1); } - public: +public: Literal() : type(WasmType::none), i64(0) {} explicit Literal(WasmType type) : type(type), i64(0) {} explicit Literal(int32_t init) : type(WasmType::i32), i32(init) {} @@ -54,6 +54,9 @@ private: explicit Literal(float init) : type(WasmType::f32), i32(bit_cast<int32_t>(init)) {} explicit Literal(double init) : type(WasmType::f64), i64(bit_cast<int64_t>(init)) {} + bool isConcrete() { return type != none; } + bool isNull() { return type == none; } + Literal castToF32(); Literal castToF64(); Literal castToI32(); @@ -76,6 +79,7 @@ private: int64_t getBits() const; bool operator==(const Literal& other) const; bool operator!=(const Literal& other) const; + bool bitwiseEqual(const Literal& other) const; static uint32_t NaNPayload(float f); static uint64_t NaNPayload(double f); |