diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2019-04-16 16:47:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-16 16:47:50 -0700 |
commit | 4d81752204fede13d6513def4195aabe66c5586f (patch) | |
tree | f6322eaa40e0fc38beaa7ca68dc3b55b8629f473 /src/tools/wasm-reduce.cpp | |
parent | 698fddca4e598cb4f72fe61557c9f91ed879a289 (diff) | |
download | binaryen-4d81752204fede13d6513def4195aabe66c5586f.tar.gz binaryen-4d81752204fede13d6513def4195aabe66c5586f.tar.bz2 binaryen-4d81752204fede13d6513def4195aabe66c5586f.zip |
Change default feature set to MVP (#1993)
In the absence of the target features section or command line flags. When there are command line flags, it is an error if they do not exactly match the target features section, except if --detect-features has been provided.
Also adds a --print-features pass to print the command line flags for all enabled options and uses it to make the feature tests more rigorous.
Diffstat (limited to 'src/tools/wasm-reduce.cpp')
-rw-r--r-- | src/tools/wasm-reduce.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp index 1f58da0d5..e064abbcb 100644 --- a/src/tools/wasm-reduce.cpp +++ b/src/tools/wasm-reduce.cpp @@ -271,7 +271,9 @@ struct Reducer : public WalkerPass<PostWalker<Reducer, UnifiedExpressionVisitor< // try both combining with a generic shrink (so minor pass overhead is compensated for), and without for (auto pass : passes) { std::string currCommand = Path::getBinaryenBinaryTool("wasm-opt") + " "; - currCommand += working + " -o " + test + " " + pass; + // TODO(tlively): -all should be replaced with an option to use the + // existing feature set, once implemented. + currCommand += working + " -all -o " + test + " " + pass; if (debugInfo) currCommand += " -g "; if (verbose) std::cerr << "| trying pass command: " << currCommand << "\n"; if (!ProgramResult(currCommand).failed()) { @@ -321,6 +323,7 @@ struct Reducer : public WalkerPass<PostWalker<Reducer, UnifiedExpressionVisitor< Module wasm; ModuleReader reader; reader.read(working, *module); + wasm.features = FeatureSet::All; builder = make_unique<Builder>(*module); setModule(module.get()); } @@ -999,7 +1002,9 @@ int main(int argc, const char* argv[]) { std::cerr << "|checking that command has expected behavior on canonicalized (read-written) binary\n"; { // read and write it - auto cmd = Path::getBinaryenBinaryTool("wasm-opt") + " " + input + " -o " + test; + // TODO(tlively): -all should be replaced with an option to use the existing + // feature set, once implemented. + auto cmd = Path::getBinaryenBinaryTool("wasm-opt") + " " + input + " -all -o " + test; if (!binary) cmd += " -S"; ProgramResult readWrite(cmd); if (readWrite.failed()) { |