diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-20 20:27:16 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-20 20:27:16 -0800 |
commit | 02d9f159c96f46730c6a2f472521b11ec537a26c (patch) | |
tree | 961fdb375dd4fb87d8bf594921d2ad144b3ef9f6 /src/emscripten-optimizer | |
parent | 001f91409ce55cc416565e2e28b3a0d4a171d728 (diff) | |
download | binaryen-02d9f159c96f46730c6a2f472521b11ec537a26c.tar.gz binaryen-02d9f159c96f46730c6a2f472521b11ec537a26c.tar.bz2 binaryen-02d9f159c96f46730c6a2f472521b11ec537a26c.zip |
detect minified fround
Diffstat (limited to 'src/emscripten-optimizer')
-rw-r--r-- | src/emscripten-optimizer/optimizer-shared.cpp | 8 | ||||
-rw-r--r-- | src/emscripten-optimizer/optimizer.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/emscripten-optimizer/optimizer-shared.cpp b/src/emscripten-optimizer/optimizer-shared.cpp index ae346d756..e37408b19 100644 --- a/src/emscripten-optimizer/optimizer-shared.cpp +++ b/src/emscripten-optimizer/optimizer-shared.cpp @@ -129,7 +129,7 @@ static void abort_on(Ref node) { abort(); } -AsmSign detectSign(Ref node) { +AsmSign detectSign(Ref node, IString minifiedFround) { IString type = node[0]->getIString(); if (type == BINARY) { IString op = node[1]->getIString(); @@ -160,11 +160,11 @@ AsmSign detectSign(Ref node) { } else if (type == NAME) { return ASM_FLEXIBLE; } else if (type == CONDITIONAL) { - return detectSign(node[2]); + return detectSign(node[2], minifiedFround); } else if (type == CALL) { - if (node[1][0] == NAME && node[1][1] == MATH_FROUND) return ASM_NONSIGNED; + if (node[1][0] == NAME && (node[1][1] == MATH_FROUND || node[1][1] == minifiedFround)) return ASM_NONSIGNED; } else if (type == SEQ) { - return detectSign(node[2]); + return detectSign(node[2], minifiedFround); } abort_on(node); abort(); // avoid warning diff --git a/src/emscripten-optimizer/optimizer.h b/src/emscripten-optimizer/optimizer.h index fe1c18770..4720909a5 100644 --- a/src/emscripten-optimizer/optimizer.h +++ b/src/emscripten-optimizer/optimizer.h @@ -130,7 +130,7 @@ enum AsmSign { ASM_NONSIGNED = 3, }; -extern AsmSign detectSign(cashew::Ref node); +extern AsmSign detectSign(cashew::Ref node, cashew::IString minifiedFround); #endif // __optimizer_h__ |