diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2019-04-12 18:27:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-12 18:27:13 -0700 |
commit | 9495b338121140d585648d64fb99e8ef7f92f867 (patch) | |
tree | 57418b1f685a4a5a43ee291759f64e9a763b1245 /src/tools/wasm-opt.cpp | |
parent | 883d14de7157950063f74b81658d00df0d53be8d (diff) | |
download | binaryen-9495b338121140d585648d64fb99e8ef7f92f867.tar.gz binaryen-9495b338121140d585648d64fb99e8ef7f92f867.tar.bz2 binaryen-9495b338121140d585648d64fb99e8ef7f92f867.zip |
Move features from passOptions to Module (#2001)
This allows us to emit a (potentially modified) target features
section and conditionally emit other sections such as the DataCount
section based on the presence of features.
Diffstat (limited to 'src/tools/wasm-opt.cpp')
-rw-r--r-- | src/tools/wasm-opt.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/wasm-opt.cpp b/src/tools/wasm-opt.cpp index d36459a4a..6fce0f89b 100644 --- a/src/tools/wasm-opt.cpp +++ b/src/tools/wasm-opt.cpp @@ -162,26 +162,26 @@ int main(int argc, const char* argv[]) { Fatal() << "error in building module, std::bad_alloc (possibly invalid request for silly amounts of memory)"; } - options.calculateFeatures(wasm); + options.applyFeatures(wasm); if (options.passOptions.validate) { - if (!WasmValidator().validate(wasm, options.passOptions.features)) { + if (!WasmValidator().validate(wasm)) { WasmPrinter::printModule(&wasm); Fatal() << "error in validating input"; } } } else { // translate-to-fuzz + options.applyFeatures(wasm); TranslateToFuzzReader reader(wasm, options.extra["infile"]); if (fuzzPasses) { reader.pickPasses(options); } - reader.setFeatures(options.passOptions.features); reader.setAllowNaNs(fuzzNaNs); reader.setAllowMemory(fuzzMemory); reader.build(); if (options.passOptions.validate) { - if (!WasmValidator().validate(wasm, options.passOptions.features)) { + if (!WasmValidator().validate(wasm)) { WasmPrinter::printModule(&wasm); std::cerr << "translate-to-fuzz must always generate a valid module"; abort(); @@ -241,7 +241,7 @@ int main(int argc, const char* argv[]) { WasmBinaryBuilder parser(other, input, false); parser.read(); if (options.passOptions.validate) { - bool valid = WasmValidator().validate(other, options.passOptions.features); + bool valid = WasmValidator().validate(other); if (!valid) { WasmPrinter::printModule(&other); } @@ -256,7 +256,7 @@ int main(int argc, const char* argv[]) { options.runPasses(*curr); if (options.passOptions.validate) { bool valid = - WasmValidator().validate(*curr, options.passOptions.features); + WasmValidator().validate(*curr); if (!valid) { WasmPrinter::printModule(&*curr); } |