summaryrefslogtreecommitdiff
path: root/src/tools/wasm-opt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/wasm-opt.cpp')
-rw-r--r--src/tools/wasm-opt.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/tools/wasm-opt.cpp b/src/tools/wasm-opt.cpp
index 421bcca59..3e04fc644 100644
--- a/src/tools/wasm-opt.cpp
+++ b/src/tools/wasm-opt.cpp
@@ -69,7 +69,6 @@ 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;
@@ -106,9 +105,6 @@ 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; })
@@ -134,11 +130,6 @@ int main(int argc, const char* argv[]) {
options.parse(argc, argv);
Module wasm;
- // It should be safe to just always enable atomics in wasm-opt, because we
- // don't expect any passes to accidentally generate atomic ops
- FeatureSet features = Feature::Atomics;
- // Same for MutableGlobals
- features |= Feature::MutableGlobals;
if (options.debug) std::cerr << "reading...\n";
@@ -160,7 +151,7 @@ int main(int argc, const char* argv[]) {
}
if (options.passOptions.validate) {
- if (!WasmValidator().validate(wasm, features)) {
+ if (!WasmValidator().validate(wasm, options.getFeatures())) {
WasmPrinter::printModule(&wasm);
Fatal() << "error in validating input";
}
@@ -171,9 +162,9 @@ int main(int argc, const char* argv[]) {
if (fuzzPasses) {
reader.pickPasses(options);
}
- reader.build(fuzzAtomics);
+ reader.build(options.getFeatures());
if (options.passOptions.validate) {
- if (!WasmValidator().validate(wasm, features)) {
+ if (!WasmValidator().validate(wasm, options.getFeatures())) {
WasmPrinter::printModule(&wasm);
std::cerr << "translate-to-fuzz must always generate a valid module";
abort();
@@ -226,7 +217,7 @@ int main(int argc, const char* argv[]) {
WasmBinaryBuilder parser(other, input, false);
parser.read();
if (options.passOptions.validate) {
- bool valid = WasmValidator().validate(other, features);
+ bool valid = WasmValidator().validate(other, options.getFeatures());
if (!valid) {
WasmPrinter::printModule(&other);
}
@@ -240,7 +231,7 @@ int main(int argc, const char* argv[]) {
auto runPasses = [&]() {
options.runPasses(*curr);
if (options.passOptions.validate) {
- bool valid = WasmValidator().validate(*curr, features);
+ bool valid = WasmValidator().validate(*curr, options.getFeatures());
if (!valid) {
WasmPrinter::printModule(&*curr);
}