[PATCH] D81887: [lld-macho] Refactor segment/section creation, sorting, and merging

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 16 18:06:02 PDT 2020


int3 marked 2 inline comments as done.
int3 added inline comments.


================
Comment at: lld/MachO/OutputSegment.cpp:41
   size_t count = 0;
-  for (const OutputSegment::SectionMapEntry &i : sections) {
-    OutputSection *os = i.second;
-    count += (!os->isHidden() ? 1 : 0);
+  for (const OutputSection *osec : sections) {
+    count += (!osec->isHidden() ? 1 : 0);
----------------
compnerd wrote:
> Nit: `section` instead of `osec` would be nicer IMO.
in addition to paralleling `isec`, it's also the naming convention used by lld-ELF...


================
Comment at: lld/MachO/Writer.cpp:347
+  }
+  return 0;
+}
----------------
compnerd wrote:
> I think that this might be easier to read as a `llvm::StringSwitch`.
TIL about StringSwitch, thanks


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81887





More information about the llvm-commits mailing list