diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-05-29 16:39:17 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-05-29 16:39:17 -0700 |
commit | f33f1dbbee7b3f95d8437f1ee60c9075013858b6 (patch) | |
tree | f0f7a4bc5cd7d948f4285298b3b3930f30cc0185 /src/wasm.h | |
parent | 1715b4a1ec845f1dd6b08f48a599f346beb0f758 (diff) | |
parent | 44aeb85b2fa2c743e2d0f7e00349f99cfcbc7639 (diff) | |
download | binaryen-f33f1dbbee7b3f95d8437f1ee60c9075013858b6.tar.gz binaryen-f33f1dbbee7b3f95d8437f1ee60c9075013858b6.tar.bz2 binaryen-f33f1dbbee7b3f95d8437f1ee60c9075013858b6.zip |
Merge pull request #550 from WebAssembly/dfe-nice
Duplicate function elimination
Diffstat (limited to 'src/wasm.h')
-rw-r--r-- | src/wasm.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/wasm.h b/src/wasm.h index e8f82f47c..f59e4368f 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -250,6 +250,14 @@ private: } } + int64_t getBits() { + switch (type) { + case WasmType::i32: case WasmType::f32: return i32; + case WasmType::i64: case WasmType::f64: return i64; + default: abort(); + } + } + bool operator==(const Literal& other) const { if (type != other.type) return false; switch (type) { @@ -262,6 +270,10 @@ private: } } + bool operator!=(const Literal& other) const { + return !(*this == other); + } + static uint32_t NaNPayload(float f) { assert(std::isnan(f) && "expected a NaN"); // SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF |