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

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 22 13:00:04 PDT 2021


oontvoo 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 *>>;
 
----------------
int3 wrote:
> 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`?
I was thinking something simple as `SubsectionEntry`
(map or vector or whatnot is implementation-details, no?)

/bikeshedding 




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