From 47607d445b62c98017ce4b9c6cc69b61fae85aa5 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Sun, 8 Nov 2020 12:24:27 -0800 Subject: Remove dead code and unused includes. NFC. (#3328) Specifically try to cleanup use of asm_v_wasm.h and asmjs constants. --- src/passes/TrapMode.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/passes/TrapMode.cpp') diff --git a/src/passes/TrapMode.cpp b/src/passes/TrapMode.cpp index f3cf3c63c..528357d4a 100644 --- a/src/passes/TrapMode.cpp +++ b/src/passes/TrapMode.cpp @@ -20,7 +20,6 @@ // generates a check and replaces the result with zero in that case. // -#include "asm_v_wasm.h" #include "asmjs/shared-constants.h" #include "ir/trapping.h" #include "mixed_arena.h" @@ -38,6 +37,18 @@ Name I64U_REM("i64u-rem"); Name I64S_DIV("i64s-div"); Name I64U_DIV("i64u-div"); +static Expression* ensureDouble(Expression* expr, MixedArena& allocator) { + if (expr->type == Type::f32) { + auto conv = allocator.alloc(); + conv->op = PromoteFloat32; + conv->value = expr; + conv->type = Type::f64; + return conv; + } + assert(expr->type == Type::f64); + return expr; +} + Name getBinaryFuncName(Binary* curr) { switch (curr->op) { case RemSInt32: -- cgit v1.2.3