diff options
author | Benjamin Bouvier <public@benj.me> | 2018-11-16 19:49:00 +0100 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2018-11-16 10:49:00 -0800 |
commit | fa0dfb6a3da3d05e01051a72d9348b2f3024222b (patch) | |
tree | e72f8174f0da8b9577a4800ddbc985bf39dbda15 /src/tools/wasm-opt.cpp | |
parent | 82685aec4167a8c7557b1c1fe0bca44feb7a540b (diff) | |
download | binaryen-fa0dfb6a3da3d05e01051a72d9348b2f3024222b.tar.gz binaryen-fa0dfb6a3da3d05e01051a72d9348b2f3024222b.tar.bz2 binaryen-fa0dfb6a3da3d05e01051a72d9348b2f3024222b.zip |
wasm-opt: Add an option to select generation of atomic opcodes at runtime (#1751)
partially solves #1676.
Diffstat (limited to 'src/tools/wasm-opt.cpp')
-rw-r--r-- | src/tools/wasm-opt.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tools/wasm-opt.cpp b/src/tools/wasm-opt.cpp index 278a9879d..7d35efeab 100644 --- a/src/tools/wasm-opt.cpp +++ b/src/tools/wasm-opt.cpp @@ -69,6 +69,7 @@ int main(int argc, const char* argv[]) { bool fuzzBinary = false; std::string extraFuzzCommand; bool translateToFuzz = false; + bool fuzzAtomics = true; bool fuzzPasses = false; std::string emitJSWrapper; std::string emitSpecWrapper; @@ -105,6 +106,9 @@ int main(int argc, const char* argv[]) { .add("--translate-to-fuzz", "-ttf", "Translate the input into a valid wasm module *somehow*, useful for fuzzing", Options::Arguments::Zero, [&](Options *o, const std::string& arguments) { translateToFuzz = true; }) + .add("--no-fuzz-atomics", "-nfa", "Disable generation of atomic opcodes with translate-to-fuzz (on by default)", + Options::Arguments::Zero, + [&](Options *o, const std::string& arguments) { fuzzAtomics = false; }) .add("--fuzz-passes", "-fp", "Pick a random set of passes to run, useful for fuzzing. this depends on translate-to-fuzz (it picks the passes from the input)", Options::Arguments::Zero, [&](Options *o, const std::string& arguments) { fuzzPasses = true; }) @@ -165,7 +169,7 @@ int main(int argc, const char* argv[]) { if (fuzzPasses) { reader.pickPasses(options); } - reader.build(); + reader.build(fuzzAtomics); if (options.passOptions.validate) { if (!WasmValidator().validate(wasm, features)) { WasmPrinter::printModule(&wasm); |