[PATCH] D113241: [lld-macho][nfc] rename parsed-section types & variables

Greg McGary via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 7 12:50:28 PST 2021


gkm added a comment.

In D113241#3114368 <https://reviews.llvm.org/D113241#3114368>, @thevinster wrote:

> I'm a big fan of the variable names switching from s/subsections/sections, s/subsectionMap/subsections. It's clearer to me that there are layers whereas the original subsections->subsectionMap layer is not as easily decipherable.

Yes, that really is the crux of this effort. It is good to hear that this change helps newcomers to the code.

> Section->SectionHeader makes sense to me, but I would like it if we had some consistency, which means also renaming SegmentCommand->SegmentCommandHeader, NList->NListHeader, etc.

In `InputFiles.cpp`, sections are front & center, and disambiguating the several varieties of them is important. `Section`->`SectionHeader` has value because it offloads the overloaded name `Section`.

OTOH, `SegmentCommand` is not overloaded, and used only once. `Nlist` is not overloaded, and isn't even a header but rather an element in a vector.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113241



More information about the llvm-commits mailing list