This is an archive of the discontinued LLVM Phabricator instance.

Rename InputSectionDescription SectionPattern.
Needs ReviewPublic

Authored by ruiu on Oct 23 2018, 4:06 PM.

Details

Summary

"InputSectionDescription" is a bad name for a class that is used very
frequently, which hurts code readability. We need a shorter, less
descriptive name for a common concept. At least that's how we name classes
in lld. Originally, that class was not intended to be used at many places,
but it has grown beyond my expectation. It should have been given a
shorter name from the beginning.

We had "SectionPattern" class. In this patch, that class was renamed
"Wildcard".

Event Timeline

ruiu created this revision.Oct 23 2018, 4:06 PM
grimar added inline comments.Oct 24 2018, 2:13 AM
lld/ELF/Arch/ARM.cpp
40

This just should have been named IS initially it seems.

lld/ELF/LinkerScript.h
146

SectionPattern -> Wildcard renaming looks good to me.

It also matches the linker script doc and sounds IMO better than SectionPattern:
https://sourceware.org/binutils/docs/ld/Input-Section-Wildcards.html#Input-Section-Wildcards

161

Honestly, I do not feel SectionPattern is a better name.

As far I remember we named it InputSectionDescription because it was named like that in the ld documentation:
https://sourceware.org/binutils/docs/ld/Input-Section-Basics.html
And I think we usually tried to follow the documented names in such cases, even if they were not ideal. Though in this case
I see probably see nothing wrong with the naming in the documentation.

What about renaming to SectionDescription? It is also short.