Skip to content

Commit c97d6e4

Browse files
authored
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.
1 parent f62e171 commit c97d6e4

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/tools/wasm-emscripten-finalize.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,14 @@ int main(int argc, const char* argv[]) {
310310
passRunner.run();
311311
}
312312

313+
// If DWARF is unused, strip it out. This avoids us keeping it alive
314+
// until wasm-opt strips it later.
315+
if (!DWARF) {
316+
PassRunner passRunner(&wasm);
317+
passRunner.add("strip-dwarf");
318+
passRunner.run();
319+
}
320+
313321
Output output(outfile, emitBinary ? Flags::Binary : Flags::Text);
314322
ModuleWriter writer;
315323
writer.setDebugInfo(debugInfo);

0 commit comments

Comments
 (0)