summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-10-25 16:36:05 -0700
committerGitHub <noreply@github.com>2021-10-25 16:36:05 -0700
commitf1f4acfa7c69f14d415a3fe0eef8439c9bde1cb4 (patch)
treeae0aeacf1d5b0266e547c2dec2b8ba25d529778f /src/tools
parent1a7169113a65a401cd2ccfd3beb988b38cda9728 (diff)
downloadbinaryen-f1f4acfa7c69f14d415a3fe0eef8439c9bde1cb4.tar.gz
binaryen-f1f4acfa7c69f14d415a3fe0eef8439c9bde1cb4.tar.bz2
binaryen-f1f4acfa7c69f14d415a3fe0eef8439c9bde1cb4.zip
Reducer: Apply --debug to all commands (#4275)
Do so by applying --debug to extraFlags right at the start. That global is used everywhere already. In particular, this PR removes manually adding -g in the first diff chunk here, and you can see extraFlags appears there already on the previous line.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/wasm-reduce.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp
index 6a442aeba..eff46bbcf 100644
--- a/src/tools/wasm-reduce.cpp
+++ b/src/tools/wasm-reduce.cpp
@@ -289,9 +289,6 @@ struct Reducer
for (auto pass : passes) {
std::string currCommand = Path::getBinaryenBinaryTool("wasm-opt") + " ";
currCommand += working + " -o " + test + " " + pass + " " + extraFlags;
- if (debugInfo) {
- currCommand += " -g ";
- }
if (!binary) {
currCommand += " -S ";
}
@@ -1260,6 +1257,9 @@ int main(int argc, const char* argv[]) {
[&](Options* o, const std::string& argument) { input = argument; });
options.parse(argc, argv);
+ if (debugInfo) {
+ extraFlags += " -g ";
+ }
if (getTypeSystem() == TypeSystem::Nominal) {
extraFlags += " --nominal";
}
@@ -1282,6 +1282,7 @@ int main(int argc, const char* argv[]) {
std::cerr << "|test: " << test << '\n';
std::cerr << "|working: " << working << '\n';
std::cerr << "|bin dir: " << binDir << '\n';
+ std::cerr << "|extra flags: " << extraFlags << '\n';
// get the expected output
copy_file(input, test);