[PATCH] D98837: [lld][MachO] Refactor handling of subsections

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 29 09:44:52 PDT 2021


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

lgtm, would be nice if you could change that for loop though



================
Comment at: lld/MachO/InputFiles.cpp:419
+  // If subsectionsViaSymbols is True then the corresponding subsections will be
+  // created, otherwise these boundaries are used for the calculation of symbols
+  // sizes only.
----------------



================
Comment at: lld/MachO/InputFiles.cpp:425
+        !subsections[sym.n_sect - 1].empty()) {
+      SubsectionMapping &subsectionMapping = subsections[sym.n_sect - 1];
+      subsectionMapping.push_back(
----------------
nit: the variable is called `subsectionMap` in the loop below, can we standardize?


================
Comment at: lld/MachO/InputFiles.cpp:417-419
   // resize(), not reserve(), because we are going to create N_ALT_ENTRY symbols
   // out-of-sequence.
   symbols.resize(nList.size());
----------------
int3 wrote:
> I guess this can be `reserve` now, and the loop on line 452 turned into a for-range loop
not yet addressed


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98837



More information about the llvm-commits mailing list