[PATCH] D44311: [WebAssembly] Implement -print-gc-sections to test global GC

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 13 12:43:32 PDT 2018


sbc100 added inline comments.


================
Comment at: wasm/InputGlobal.h:55
+  return (toString(G->File) + ":(" + G->getName() + ")").str();
+}
+
----------------
ncw wrote:
> sbc100 wrote:
> > Non of this is needed if you don't include globals in the output of --print-gc-section.
> True... but it's not a lot of code, and why would we support and test `--print-gc-section` for functions but not globals? I added it because otherwise the existing tests would look lopsided. It seems odd if the test has an assertion that does: "check that a function and a global were GC'd and the logging indicates that the function but not the global was GC'd".
There a couple of reasons I don't think this is needed/wanted.  Firstly, I don't consider wasm globals to be sections.  Secondly that building of types and globals section I chose not be contolled by the --gc-sections flag.  Rather its always generated precisely, based on the inputs.  In the future maybe we could revisit this, and maybe we want to completely remove --gc-section/--print-gc-sections from the wasm port, since we probably always want to enable them.   However I think this incremental change muddies the water.

Perhaps once we have more use for wasm globals we can revisit?   At least then we won't need to include the yaml test input.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D44311





More information about the llvm-commits mailing list