summaryrefslogtreecommitdiff
path: root/src/emscripten-optimizer/simple_ast.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make `Name` a pointer, length pair (#5122)Thomas Lively2022-10-111-8/+6
| | | | | | | | | | | | | | | | | | | | | | | 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.
* clang-tidy braces changes (#2075)Alon Zakai2019-05-011-5/+8
| | | 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-25/+27
| | | 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
* wasm2js: remove unneeded break/continue labels (#2058)Alon Zakai2019-04-261-61/+0
|
* wasm2js: start to optionally optimize the JS (#2046)Alon Zakai2019-04-241-168/+43
| | | Removes redundant | 0s and similar things. (Apparently closure compiler doesn't do that, so makes sense to do here.)
* Code style improvements (#1868)Alon Zakai2019-01-151-4/+5
| | | | * Use modern T p = v; notation to initialize class fields * Use modern X() = default; notation for empty class constructors
* standardize on 'template<' over 'template <' (i.e., remove a space) (#1782)Alon Zakai2018-11-291-1/+1
|
* refactor asm.js ast to use an AssignName node, for the common case of ↵Alon Zakai (kripken)2017-01-311-0/+18
| | | | assigning to a name and not an arbitrary ast node
* refactor asm.js ast to not use STAT nodes - we don't need to print the ↵Alon Zakai (kripken)2017-01-311-4/+0
| | | | asm.js anyhow, so knowing where ;s are is unnecessary bloat
* refactor asm.js ast to use an Assign nodeAlon Zakai (kripken)2017-01-311-1/+101
|
* use MixedArena in asm.js astAlon Zakai (kripken)2017-01-311-35/+10
|
* refactor asm.js ast to use a string node directly instead of [NAME, string]Alon Zakai (kripken)2017-01-311-1/+1
|
* refactor asm.js ast to use a number node directly instead of [NUM, number]Alon Zakai (kripken)2017-01-301-1/+1
|
* clean up in emscripten-optimizer arenasAlon Zakai2016-04-271-0/+9
|
* 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.
* if is not statableAlon Zakai2015-12-061-1/+1
|
* restructure code, put emscripten-optimizer stuff in its own dirAlon Zakai2015-11-091-0/+259