[PATCH] D44313: [WebAssembly] Implement GC for imports

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 9 13:52:59 PST 2018


ruiu added inline comments.


================
Comment at: wasm/Symbols.h:78-79
 
+  // Marks the symbol as Live, so that it will be included in the final image.
+  void markLive();
+
----------------
sbc100 wrote:
> ruiu wrote:
> > I don't think we should add a notion of "liveness" to symbols. It is easy to be confused, but "liveness" is for chunks, data, globals, etc, and symbols themselves are not subject of GC. I understand that since each wasm global have only one symbol associated with it, that distinction is ambiguous, but I still want to maintain that distinction to make things easy to understand.
> But for undefined symbols we need to know which ones to write to the relocatable output.  For undefined symbols there is no chunk.
> 
> We already have in in ELF/Symbols.h: `unsigned Used : 1;`
> 
> If you prefer we can give it the same name here for consistency.
> 
> I'm not sure there is any difference between `Used` and `Live` though, so it might be worth renaming the one in ELF?
If symbol is referenced by someone else, we have to do something in some cases. E.g. we have to put it to the dynamic symbol table if it is being used. But that's different from garbage collection.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D44313





More information about the llvm-commits mailing list