summaryrefslogtreecommitdiff
path: root/src/tools/wasm-opt.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-05-17 11:39:16 -0700
committerGitHub <noreply@github.com>2021-05-17 11:39:16 -0700
commitadba99a760ceb50adb5856e0010fc158163ef607 (patch)
treee6e0a3a89645014305f66b9229e27620e8e5a46a /src/tools/wasm-opt.cpp
parentdeff1560a29c0002d6de5c979da3f4875c1faee6 (diff)
downloadbinaryen-adba99a760ceb50adb5856e0010fc158163ef607.tar.gz
binaryen-adba99a760ceb50adb5856e0010fc158163ef607.tar.bz2
binaryen-adba99a760ceb50adb5856e0010fc158163ef607.zip
Do not attempt to preserve DWARF if a previous pass removes it (#3887)
If we run a pass that removes DWARF followed by one that could destroy it, then there is no possible problem - there is nothing left to destroy. We can run the later pass with no issues (and no warnings). Also add an assertion on running a pass runner only once. That has always been the assumption, and now that we track whether the added passes remove debug info, we need to check it. Fixes emscripten-core/emscripten#14161
Diffstat (limited to 'src/tools/wasm-opt.cpp')
-rw-r--r--src/tools/wasm-opt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/wasm-opt.cpp b/src/tools/wasm-opt.cpp
index 8884619fe..45d394162 100644
--- a/src/tools/wasm-opt.cpp
+++ b/src/tools/wasm-opt.cpp
@@ -61,7 +61,7 @@ static std::string runCommand(std::string command) {
static bool willRemoveDebugInfo(const std::vector<std::string>& passes) {
for (auto& pass : passes) {
- if (pass == "strip" || pass == "strip-debug" || pass == "strip-dwarf") {
+ if (PassRunner::passRemovesDebugInfo(pass)) {
return true;
}
}