[PATCH] D24616: [ELF] Improve section GC for comdat groups

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 12:34:34 PDT 2016


evgeny777 added inline comments.

================
Comment at: ELF/MarkLive.cpp:263-269
@@ -244,3 +262,9 @@
+
+  // Pass 2. Identify and mark reachable comdat groups.
+  for (ObjectFile<ELFT> *F : Symtab<ELFT>::X->getObjectFiles())
+    for (InputSectionBase<ELFT> *Sec : F->getComdatSections(LiveComdatGroups))
+      Enqueue({Sec->getFile(), Sec, 0});
+
   while (!Q.empty())
     forEachSuccessor<ELFT>(*Q.pop_back_val(), Enqueue);
 }
----------------
ruiu wrote:
> I don't think this is correct because the last `forEachSuccessor` could mark a section in a comdat group live, so you want to repeat this process until converge.
The piece of code on lines 214-215 :

```
 if (R.Sec->Live)
    return;
```

handles this, no?


Repository:
  rL LLVM

https://reviews.llvm.org/D24616





More information about the llvm-commits mailing list