summaryrefslogtreecommitdiff
path: root/src/support/command-line.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix for cmake 3.10 (eg on Ubuntu LTS) (#2632)Brion Vibber2020-01-301-1/+1
| | | | | | | | | CMAKE_PROJECT_VERSION is only predefined on cmake 3.12 and later, so the previous code produced an empty version number which leads to parsing errors when emcc checks the version. Use of the older PROJECT_VERSION variable as the source of the original version works here, as there's only one toplevel project defined.
* Verify --version output matches CHANGELOG (#2580)Sam Clegg2020-01-101-1/+1
| | | | | | | | | | | | | | | | | The new version string looks like this: wasm-opt version 90 (version_90-18-g77329439d) The version reported here is the version from the CMakeLists.txt file followed by the git version in brackets. We verify that the main version here matches the CHANGELOG to prevent people from changing one without changeing the other. This will help with emscripten that wants to be able to programaticaly check the --version of binaryen tools. See https://github.com/emscripten-core/emscripten/issues/10175
* Remove git dependency (#2578)Sam Clegg2020-01-081-1/+1
| | | | | | | Only use git to set version number if .git directory is present. This means that for release archives the VERSION string will be used as-is. Fixes #2563
* Add BYN_DEBUG/BYN_TRACE macros similar to LLVM's debug system (#2496)Sam Clegg2019-12-041-2/+6
| | | | | | | | | This allows for debug trace message to be split my channel. So you can pass `--debug` to simply debug everything, or `--debug=opt` to only debug wasm-opt. This change is the initial introduction but as a followup I hope to convert all tracing over to this new system so we can more easily control the debug output.
* Support --version argument in command line tools (#2304)Sam Clegg2019-08-201-0/+9
|
* clang-tidy braces changes (#2075)Alon Zakai2019-05-011-6/+12
| | | 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-11/+24
| | | 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
* Use stdout for --help message (#1937)Sam Clegg2019-03-061-9/+9
| | | | Noramlly --help is considered normal output not error output. For example its normally to pipe the output of --help to a pager.
* wasm-metadce tool (#1320)Alon Zakai2017-12-061-1/+5
| | | | | | | This adds a new tool for better dead code elimination. The problem this helps overcome is when the wasm module is part of something larger, like a wasm+JS combination, and therefore doing DCE in either one is not sufficient as it can't remove a cycle spanning the wasm and JS worlds. Concretely, when binaryen performs DCE by itself, it can never remove an export, because it considers those roots - but in the larger ("meta") space outside, they may actually be removable. To solve that, this tool receives a description of the outside graph (in very abstract form), including which nodes are roots. It then adds to that graph nodes from the wasm, so that we have a single graph representing the entire space (the outside + wasm + connections between them). It then performs DCE, finding what is not reachable from the roots, and cleaning it up from the wasm. It of course can't clean up things from the outside, since all it has is the abstract representation of those things in the graph, but it prints out the ids of the removable nodes, which an outside tool can use. This tool is written in as general a way as possible, hopefully it can have multiple uses. The use I have in mind is to write something in emscripten that uses this to DCE the JS+wasm combination that we emit.
* more consistent placement of & and *, on the type (#848)Alon Zakai2016-11-281-15/+15
|
* Wrap description (#839)Loo Rong Jie2016-11-281-4/+31
|
* make --debug workAlon Zakai2016-03-211-1/+1
|
* Make --debug a booleanJF Bastien2016-03-181-5/+3
| | | | As discussed in #248.
* Fix command-line help when there's only long or shortJF Bastien2016-01-201-2/+4
|
* asm2wasm: use support's command-lineJF Bastien2016-01-111-7/+18
|
* Fix off-by-one in option parsing with '='.JF Bastien2016-01-041-1/+1
|
* Add curlies.JF Bastien2016-01-041-2/+4
|
* Generalize command-line parsing more.JF Bastien2016-01-021-38/+108
| | | | This should allow other programs to use the same command-line support.
* Add a help to avoid out-of-bounds.JF Bastien2015-12-291-1/+4
|
* Start moving command-line processing to libsupport.aJF Bastien2015-12-291-0/+62
This only moves things, no functional change yet.