[PATCH] D98837: [lld][MachO] Refactor handling of subsections
Jez Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 22 13:04:17 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:
> > 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
>
>
`std::vector<SubsectionEntry>` seems good too yeah
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