summaryrefslogtreecommitdiff
path: root/src/tools/wasm-opt.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-06-07 11:31:35 -0700
committerGitHub <noreply@github.com>2019-06-07 11:31:35 -0700
commit284c9357d84165b51e04fa939debddeedbf2eb99 (patch)
tree8ed2a7d1c751b770a7904c45b996af0ddba256bb /src/tools/wasm-opt.cpp
parentcac94c5aece24855c2d8cdc73e75f7f5abb29cd2 (diff)
downloadbinaryen-284c9357d84165b51e04fa939debddeedbf2eb99.tar.gz
binaryen-284c9357d84165b51e04fa939debddeedbf2eb99.tar.bz2
binaryen-284c9357d84165b51e04fa939debddeedbf2eb99.zip
Refactor -g param parsing (#2167)
Use one shared location in optimization-options as much as possible. This also allows tools like wasm2js to receive that flag.
Diffstat (limited to 'src/tools/wasm-opt.cpp')
-rw-r--r--src/tools/wasm-opt.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/tools/wasm-opt.cpp b/src/tools/wasm-opt.cpp
index d692d598a..130e284c2 100644
--- a/src/tools/wasm-opt.cpp
+++ b/src/tools/wasm-opt.cpp
@@ -63,7 +63,6 @@ std::string runCommand(std::string command) {
int main(int argc, const char* argv[]) {
Name entry;
bool emitBinary = true;
- bool debugInfo = false;
bool converge = false;
bool fuzzExecBefore = false;
bool fuzzExecAfter = false;
@@ -95,11 +94,6 @@ int main(int argc, const char* argv[]) {
"Emit text instead of binary for the output file",
Options::Arguments::Zero,
[&](Options* o, const std::string& argument) { emitBinary = false; })
- .add("--debuginfo",
- "-g",
- "Emit names section and debug info",
- Options::Arguments::Zero,
- [&](Options* o, const std::string& arguments) { debugInfo = true; })
.add("--converge",
"-c",
"Run passes to convergence, continuing while binary size decreases",
@@ -295,7 +289,7 @@ int main(int argc, const char* argv[]) {
ModuleWriter writer;
writer.setDebug(options.debug);
writer.setBinary(emitBinary);
- writer.setDebugInfo(debugInfo);
+ writer.setDebugInfo(options.passOptions.debugInfo);
writer.write(wasm, options.extra["output"]);
firstOutput = runCommand(extraFuzzCommand);
std::cout << "[extra-fuzz-command first output:]\n" << firstOutput << '\n';
@@ -377,7 +371,7 @@ int main(int argc, const char* argv[]) {
ModuleWriter writer;
writer.setDebug(options.debug);
writer.setBinary(emitBinary);
- writer.setDebugInfo(debugInfo);
+ writer.setDebugInfo(options.passOptions.debugInfo);
if (outputSourceMapFilename.size()) {
writer.setSourceMapFilename(outputSourceMapFilename);
writer.setSourceMapUrl(outputSourceMapUrl);