diff options
author | Ashley Nelson <nashley@google.com> | 2022-05-24 17:03:29 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-24 17:03:29 -0700 |
commit | 5ae71ee1baf590fb9bafc5d7efc3d55815fd447e (patch) | |
tree | 20d2e0470898a8d53ede404d1f644fb91ae5b60a | |
parent | 721e8ffb975a6e68a56287cd46ecc19e107211c6 (diff) | |
download | binaryen-5ae71ee1baf590fb9bafc5d7efc3d55815fd447e.tar.gz binaryen-5ae71ee1baf590fb9bafc5d7efc3d55815fd447e.tar.bz2 binaryen-5ae71ee1baf590fb9bafc5d7efc3d55815fd447e.zip |
Updating wasm-opt example to an available pass (#4684)
The wasm-opt example was using a test pass that was deleted. Updating to use one of the test passes in test/lit/passes.
-rw-r--r-- | README.md | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -367,23 +367,22 @@ passes on it, as well as print it (before and/or after the transformations). For example, try ```` -bin/wasm-opt test/passes/lower-if-else.wat --print +bin/wasm-opt test/lit/passes/name-types.wast -all -S -o - ```` -That will pretty-print out one of the test cases in the test suite. To run a +That will output one of the test cases in the test suite. To run a transformation pass on it, try ```` -bin/wasm-opt test/passes/lower-if-else.wat --print --lower-if-else +bin/wasm-opt test/lit/passes/name-types.wast --name-types -all -S -o - ```` -The `lower-if-else` pass lowers if-else into a block and a break. You can see -the change the transformation causes by comparing the output of the two print -commands. +The `name-types` pass ensures each type has a name and renames exceptionally long type names. You can see +the change the transformation causes by comparing the output of the two commands. It's easy to add your own transformation passes to the shell, just add `.cpp` files into `src/passes`, and rebuild the shell. For example code, take a look at -the [`lower-if-else` pass](https://github.com/WebAssembly/binaryen/blob/main/src/passes/LowerIfElse.cpp). +the [`name-types` pass](https://github.com/WebAssembly/binaryen/blob/main/src/passes/NameTypes.cpp). Some more notes: |