[PATCH] D33264: Garbage collect dllimported symbols.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 17:45:49 PDT 2017


pcc added a comment.

In https://reviews.llvm.org/D33264#756872, @ruiu wrote:

> That should theoretically work, but I can imagine that that will be more complicated than this. Chunks for dllimported symbols are created not when they are read from file but when writer needs them, so at the time when MarkLive runs, chunks for dllimported symbols don't exist.


I see. We could always try and create the import chunks earlier though. But that seems like a separate potential refactoring.



================
Comment at: lld/COFF/MarkLive.cpp:41
+  // Mark a given symbol as reachable.
+  std::function<void(SymbolBody * B)> AddSym = [&](SymbolBody *B) {
+    if (auto *Sym = dyn_cast<DefinedRegular>(B)) {
----------------
This could just use auto.


================
Comment at: lld/COFF/Symbols.h:310
+  // They should be considered as a unit by gc. This pointer points
+  // to each other
+  DefinedImportData *Sibling = nullptr;
----------------
nit: "to the other symbol."


https://reviews.llvm.org/D33264





More information about the llvm-commits mailing list