[PATCH] D79460: [lld-macho] Follow-up to D77893

Kellie Medlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 6 12:26:13 PDT 2020


Ktwu accepted this revision.
Ktwu added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lld/MachO/OutputSegment.cpp:43
     OutputSection *os = i.second;
-    count += (os->isHidden() ? 0 : 1);
+    count += (os->isNeeded() && !os->isHidden() ? 1 : 0);
   }
----------------
I personally find this more complicated to read :(

Knowing that hidden state isn't as simple as checking isHidden() -- isNeeded() is also needed -- seemed confusing to me :/


================
Comment at: lld/MachO/Writer.cpp:117
 
-    if (!seg->isNeeded())
+    if (seg->getSections().empty())
       return;
----------------
My bad, was this an actual bug? Why not hide the empty() check within a function?


================
Comment at: lld/MachO/Writer.cpp:128
       OutputSection *section = p.second;
+      if (!section->isNeeded())
+        continue;
----------------
Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79460





More information about the llvm-commits mailing list