summaryrefslogtreecommitdiff
path: root/src/emscripten-optimizer/optimizer-shared.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix warnings from -Wheader-hygiene and -Wimplicit-const-int-float-conversion ↵Martin Kustermann2022-11-171-0/+2
| | | | | | | | | (#5273) When `-Wheader-hygiene` is enabled, C compiler will warn when using namespace directive in global context in header file. When `-Wimplicit-const-int-float-conversion` is enabled C compiler will warn on implicit integer to double conversions that change values.
* Make `Name` a pointer, length pair (#5122)Thomas Lively2022-10-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | With the goal of supporting null characters (i.e. zero bytes) in strings. Rewrite the underlying interned `IString` to store a `std::string_view` rather than a `const char*`, reduce the number of map lookups necessary to intern a string, and present a more immutable interface. Most importantly, replace the `c_str()` method that returned a `const char*` with a `toString()` method that returns a `std::string`. This new method can correctly handle strings containing null characters. A `const char*` can still be had by calling `data()` on the `std::string_view`, although this usage should be discouraged. This change is NFC in spirit, although not in practice. It does not intend to support any particular new functionality, but it is probably now possible to use strings containing null characters in at least some cases. At least one parser bug is also incidentally fixed. Follow-on PRs will explicitly support and test strings containing nulls for particular use cases. The C API still uses `const char*` to represent strings. As strings containing nulls become better supported by the rest of Binaryen, this will no longer be sufficient. Updating the C and JS APIs to use pointer, length pairs is left as future work.
* [Refactoring] Cleanup asm2wasm. Use JS instead ASM prefix where possible. ↵Max Graey2021-09-011-246/+25
| | | | NFC (#4090)
* cleanup to allow binaryen to be built in more strict environments (#3566)walkingeyerobot2021-02-161-1/+2
|
* Simplify some numeric code (#3186)Max Graey2020-10-011-1/+1
|
* clang-tidy braces changes (#2075)Alon Zakai2019-05-011-19/+31
| | | Applies the changes in #2065, and temprarily disables the hook since it's too slow to run on a change this large. We should re-enable it in a later commit.
* Apply format changes from #2048 (#2059)Alon Zakai2019-04-261-64/+170
| | | Mass change to apply clang-format to everything. We are applying this in a PR by me so the (git) blame is all mine ;) but @aheejin did all the work to get clang-format set up and all the manual work to tidy up some things to make the output nicer in #2048
* Cleanup shared constants (#1784)Sam Clegg2018-11-291-1/+2
|
* fix sign detection of a floating-point mod ; fixes kripken/emscripten#7123 ↵Alon Zakai2018-09-151-1/+1
| | | | (#1681)
* Fix build with gcc 7 (#957)Morris Hafner2017-03-291-2/+1
| | | | 1. Add a missing <functional> include 2. Put the // fallthrough comment after the closing bracket so the compiler does not emit a implicit fallthrough warning.
* refactor asm.js ast to use a string node directly instead of [NAME, string]Alon Zakai (kripken)2017-01-311-24/+22
|
* refactor asm.js ast to use a number node directly instead of [NUM, number]Alon Zakai (kripken)2017-01-301-10/+12
|
* asm2wasm i64 support (#723)Alon Zakai2016-09-301-5/+6
| | | | | | | | | | | | * support i64 intrinsics from fastcomp, adding --wasm-only flag * refactor callImport logic in asm2wasm to avoid recomputing wasm types again * legalize illegal i64 params in exports and imports * do safe i64 binary ops depending on precision * fix addVar, only assert on names if we are using a name
* Add Travis builds with sanitizersJF Bastien2016-01-101-16/+5
| | | | | | | | | | | | | | | | This triggers 5 independent build / test runs: - clang, no sanitizer; - clang, UB sanitizer; - clang, address sanitizer (disabled for now); - clang, thread sanitizer (disabled for now); - GCC. Enabling UBSan led to these changes: - Fix a bunch of undefined behavior throughout the code base. - Fix some tests that relied on that undefined behavior. - Make some of the tests easier to debug by printing their command line. - Add ubsan blacklist to work around libstdc++ bug. - Example testcase also needs sanitizer because libsupport.a uses it.
* Fix the license headersJF Bastien2015-12-211-1/+15
| | | | This applies Apache 2.0 properly (as far as our lawyers have told me). We can do this early since all of the code was written by Alon Zakai.
* add makeSigning methodAlon Zakai2015-12-051-0/+5
|
* refactoring, and wasm2asm arags and localsAlon Zakai2015-12-011-0/+52
|
* be very careful when converting doubles to ints in asm2wasmAlon Zakai2015-11-281-0/+6
|
* fix detectSign on recursive calls that need minified froundAlon Zakai2015-11-221-4/+4
|
* detect minified fround in detectTypeAlon Zakai2015-11-201-2/+2
|
* detect minified froundAlon Zakai2015-11-201-4/+4
|
* detect seq signAlon Zakai2015-11-201-3/+12
|
* port detectSign from emscripten asm optimizer, and use itAlon Zakai2015-11-171-0/+38
|
* restructure code, put emscripten-optimizer stuff in its own dirAlon Zakai2015-11-091-0/+125