diff options
author | Alon Zakai <azakai@google.com> | 2019-12-20 16:24:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-20 16:24:16 -0800 |
commit | c97d6e4f529f181d81f1fc8c76f0ce28c16782b8 (patch) | |
tree | 3b1e9fc403873d3c1249bad94c9e298739298b54 | |
parent | f62e171c38bea14302f9b79f7941a248ea704425 (diff) | |
download | binaryen-c97d6e4f529f181d81f1fc8c76f0ce28c16782b8.tar.gz binaryen-c97d6e4f529f181d81f1fc8c76f0ce28c16782b8.tar.bz2 binaryen-c97d6e4f529f181d81f1fc8c76f0ce28c16782b8.zip |
Strip DWARF in finalize, to avoid keeping it around til later unnecessarily (#2544)
Without this, the first wasm-opt invocation will remove it. But it
can be very large, and we will soon start to automatically do
updating on it when it exists, so avoid the work if we aren't
actually building a final output with dwarf.
-rw-r--r-- | src/tools/wasm-emscripten-finalize.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tools/wasm-emscripten-finalize.cpp b/src/tools/wasm-emscripten-finalize.cpp index a32a265cd..9ade001ef 100644 --- a/src/tools/wasm-emscripten-finalize.cpp +++ b/src/tools/wasm-emscripten-finalize.cpp @@ -310,6 +310,14 @@ int main(int argc, const char* argv[]) { passRunner.run(); } + // If DWARF is unused, strip it out. This avoids us keeping it alive + // until wasm-opt strips it later. + if (!DWARF) { + PassRunner passRunner(&wasm); + passRunner.add("strip-dwarf"); + passRunner.run(); + } + Output output(outfile, emitBinary ? Flags::Binary : Flags::Text); ModuleWriter writer; writer.setDebugInfo(debugInfo); |