From adba99a760ceb50adb5856e0010fc158163ef607 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 17 May 2021 11:39:16 -0700 Subject: 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 --- src/tools/wasm-opt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tools/wasm-opt.cpp') 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& passes) { for (auto& pass : passes) { - if (pass == "strip" || pass == "strip-debug" || pass == "strip-dwarf") { + if (PassRunner::passRemovesDebugInfo(pass)) { return true; } } -- cgit v1.2.3