diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2019-04-03 18:15:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-03 18:15:00 -0700 |
commit | b175e75d2b247b3687061cf51174e72f8ada4aca (patch) | |
tree | c6de3440e440e2ccfdb11bad957c344bef239de7 /src/tools/wasm2js.cpp | |
parent | 773759f7842611bbe3e30f7b9d4cd24350291976 (diff) | |
download | binaryen-b175e75d2b247b3687061cf51174e72f8ada4aca.tar.gz binaryen-b175e75d2b247b3687061cf51174e72f8ada4aca.tar.bz2 binaryen-b175e75d2b247b3687061cf51174e72f8ada4aca.zip |
Use target features section in wasm-opt (#1967)
If the user does not supply features explicitly on the command line,
read and use the features in the target features section for
validation and passes. If the user does supply features explicitly,
error if they are not a superset of the features marked as used in the
target features section and the user does not explicitly handle this.
Diffstat (limited to 'src/tools/wasm2js.cpp')
-rw-r--r-- | src/tools/wasm2js.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/wasm2js.cpp b/src/tools/wasm2js.cpp index 277a4e2c9..6a55c4483 100644 --- a/src/tools/wasm2js.cpp +++ b/src/tools/wasm2js.cpp @@ -81,6 +81,7 @@ int main(int argc, const char *argv[]) { ModuleReader reader; reader.setDebug(options.debug); reader.read(input, wasm, ""); + options.calculateFeatures(wasm); } else { auto input( read_file<std::vector<char>>(options.extra["infile"], Flags::Text, options.debug ? Flags::Debug : Flags::Release)); @@ -99,7 +100,7 @@ int main(int argc, const char *argv[]) { } if (options.passOptions.validate) { - if (!WasmValidator().validate(wasm, options.getFeatures())) { + if (!WasmValidator().validate(wasm, options.passOptions.features)) { WasmPrinter::printModule(&wasm); Fatal() << "error in validating input"; } |