[PATCH] D59800: Use a class instead of lambda-based callbacks to organize garbage collector.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 16:09:02 PDT 2019


pcc accepted this revision.
pcc added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lld/ELF/MarkLive.cpp:255
   // Mark all reachable sections.
-  while (!Q.empty())
-    forEachSuccessor<ELFT>(*Q.pop_back_val(), Enqueue);
+  while (!Queue.empty()) {
+    InputSectionBase &Sec = *Queue.pop_back_val();
----------------
ruiu wrote:
> pcc wrote:
> > This seems fine for now, but with partitioning we'll need to do this multiple times:
> > https://github.com/pcc/llvm-project/blob/d40cc2e48b560445c4c741cc72a8c6bab47fb2eb/lld/ELF/MarkLive.cpp#L269
> > https://github.com/pcc/llvm-project/blob/d40cc2e48b560445c4c741cc72a8c6bab47fb2eb/lld/ELF/MarkLive.cpp#L288
> > 
> > Maybe it should be the user of MarkLive who adds GC roots? Then with partitioning the code will end up looking like:
> > ```
> > for (unsigned I = 1; I != NumPartitions; ++I) {
> >   MarkLive<ELFT> M(I);
> >   // enqueue symbols/sections for partition I
> >   M.mark();
> > }
> > ```
> > where `mark()` contains the code in this loop.
> Yeah maybe. This change is more like a mechanical translation with some inlining, so I don't know if I should do that now. Do you want me to modify this change?
No need to modify it. Once I start sending the partitioning changes for review I'll figure out what to do here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59800/new/

https://reviews.llvm.org/D59800





More information about the llvm-commits mailing list