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

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 22 12:55:52 PDT 2021


int3 added inline comments.


================
Comment at: lld/MachO/InputFiles.h:52
 // each subsection from the start of the original pre-split InputSection.
-using SubsectionMap = std::map<uint32_t, InputSection *>;
+using SubsectionMap = std::vector<std::pair<uint32_t, InputSection *>>;
 
----------------
oontvoo wrote:
> int3 wrote:
> > nit: can we use a struct instead of a pair? I think `first` and `second` aren't very readable
> nit: it's not a map ... perhaps you could name it something less mis-leading? :) 
> 
It's a conceptual map ;) SubsectionSortedVec seems like a mouthful

maybe `SubsectionMapping`?


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