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

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


ruiu added a comment.

InputGlobal has a "Live" member, and this patch adds a new "Live" member to Symbol which seems odd to me. It feels like something isn't quite right...



================
Comment at: wasm/MarkLive.cpp:44-47
     if (!Sym)
       return;
-    InputChunk *Chunk = Sym->getChunk();
-    if (!Chunk || Chunk->Live)
+    if (Sym->isLive())
       return;
----------------
nit: you can merge these two `if`s.


================
Comment at: wasm/Symbols.h:78-79
 
+  // Marks the symbol as Live, so that it will be included in the final image.
+  void markLive();
+
----------------
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.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D44313





More information about the llvm-commits mailing list