summaryrefslogtreecommitdiff
path: root/src/support/path.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Encode command line to UTF8 on Windows (#5671)Derek Schuff2023-09-141-0/+30
| | | | | | | | | | | | | | | | This PR changes how file paths and the command line are handled. On startup on Windows, we process the wstring version of the command line (including the file paths) and re-encode it to UTF8 before handing it off to the rest of the command line handling logic. This means that all paths are stored in UTF8-encoded std::strings as they go through the program, right up until they are used to open files. At that time, they are converted to the appropriate native format with the new to_path function before passing to the stdlib open functions. This has the advantage that all of the non-file-opening code can use a single type to hold paths (which is good since std::filesystem::path has proved problematic in some cases), but has the disadvantage that someone could add new code that forgets to convert to_path before opening. That's somewhat mitigated by the fact that most of the code uses the ModuleIOBase classes for opening files. Fixes #4995
* Avoid calling back() on an empty string in setBinaryenBinDir (#5280)Piotr Sarna2022-11-181-1/+1
| | | | | | | | | std::string::back() is only well defined for non-empty strings. Without the change, wasm-reduce fails if it is called from $PATH, because then, the parent directory is an empty string. A workaround is to explicitly set the binaryen path with -b, and it is still necessary after this fix, but at least the program ends with a comprehensible error message instead of a generic assertion failure from the standard library.
* Modernize code to C++17 (#3104)Max Graey2021-11-221-6/+2
|
* [wasm-split] Add an option to emit only the module names (#3901)Thomas Lively2021-05-251-8/+21
| | | | | | Even when other names are stripped, it can be useful for wasm-split to preserve the module name so that the split modules can be differentiated in stack traces. Adding this option to wasm-split requires adding similar options to ModuleWriter and WasmBinaryWriter.
* Fix autoreducing when not in the binaryen directory (#2390)Alon Zakai2019-10-171-5/+26
| | | | This uses argv[0] as the default way to find the location of the wasm binaries (wasm-reduce needs to call wasm-opt).
* clang-tidy braces changes (#2075)Alon Zakai2019-05-011-1/+2
| | | 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-6/+4
| | | 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
* refactor Path utils: store the bin/ dir so that all users of the API can use ↵Alon Zakai2018-03-301-0/+65
it by the standard calls, even if it was modified by user input (move it out of just being in wasm-reduce.cpp) (#1489)