summaryrefslogtreecommitdiff
path: root/src/tools/wasm-reduce.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-12-14 09:10:38 -0800
committerGitHub <noreply@github.com>2020-12-14 09:10:38 -0800
commit2de4cb54cab3d2251f48ec0f94e180b34bf398f6 (patch)
tree56f871ee1cd72040feb2e5c95a7b962bba8a7f27 /src/tools/wasm-reduce.cpp
parentdd33ae0512aa97f537d40e61631d268c8a8fd17e (diff)
downloadbinaryen-2de4cb54cab3d2251f48ec0f94e180b34bf398f6.tar.gz
binaryen-2de4cb54cab3d2251f48ec0f94e180b34bf398f6.tar.bz2
binaryen-2de4cb54cab3d2251f48ec0f94e180b34bf398f6.zip
[wasm-reduce] Improve support for reducing on text files (#3437)
Passing --detect-features there doesn't work (as there is no feature section).
Diffstat (limited to 'src/tools/wasm-reduce.cpp')
-rw-r--r--src/tools/wasm-reduce.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp
index f366eaddd..13288c79d 100644
--- a/src/tools/wasm-reduce.cpp
+++ b/src/tools/wasm-reduce.cpp
@@ -287,7 +287,9 @@ struct Reducer
currCommand += " -g ";
}
if (!binary) {
- currCommand += " -S ";
+ currCommand += " -S --all-features ";
+ } else {
+ currCommand += " --detect-features ";
}
if (verbose) {
std::cerr << "| trying pass command: " << currCommand << "\n";
@@ -1217,10 +1219,12 @@ int main(int argc, const char* argv[]) {
"(read-written) binary\n";
{
// read and write it
- auto cmd = Path::getBinaryenBinaryTool("wasm-opt") + " " + input +
- " --detect-features -o " + test;
+ auto cmd =
+ Path::getBinaryenBinaryTool("wasm-opt") + " " + input + " -o " + test;
if (!binary) {
- cmd += " -S";
+ cmd += " -S --all-features";
+ } else {
+ cmd += " --detect-features";
}
ProgramResult readWrite(cmd);
if (readWrite.failed()) {