This is an archive of the discontinued LLVM Phabricator instance.

Rename SymbolBody -> Symbol.
ClosedPublic

Authored by ruiu on Oct 31 2017, 10:13 AM.

Details

Summary

This is a mechanical change generated by

perl -i -pe s/SymbolBody/Symbol/g $(git grep -l SymbolBody lld/ELF lld/COFF)

and clang-format-diff.

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu created this revision.Oct 31 2017, 10:13 AM
ruiu edited the summary of this revision. (Show Details)Oct 31 2017, 10:19 AM

Thanks for including the steps you used to effect the mechanical change! Having maintained long-lived derived branches of open source projects in the past I've found that sort of thing very helpful.

I did not review in detail but on a skim found no errors.

grimar edited edge metadata.Nov 1 2017, 1:31 AM

I reviewed first few files and I think for me naming is confusing.
Since there is no Bodies anymore it seems to me naming is odd.
Probably it can not be solved by mechanical change.
Leaved few comments, I think the rest files have the same issue.

lld/COFF/Chunks.cpp
254 ↗(On Diff #121008)

I think Body is odd name for Symbol.

255 ↗(On Diff #121008)

And Sym is odd name for ... Defined.

331 ↗(On Diff #121008)

The same.

lld/COFF/InputFiles.cpp
189 ↗(On Diff #121008)

Same.

lld/COFF/InputFiles.h
166 ↗(On Diff #121008)

SymbolBodies does not look as good name now.

172 ↗(On Diff #121008)

The same as above.

221 ↗(On Diff #121008)

The same.

lld/COFF/LTO.cpp
96 ↗(On Diff #121008)

Same.

ruiu added a comment.Nov 1 2017, 11:04 AM

I intentionally avoided renaming variables to make this a mechanical change. I'll rename variables later, but I don't want to do that in this patch.

grimar added a comment.Nov 2 2017, 1:30 AM
In D39459#912906, @ruiu wrote:

I intentionally avoided renaming variables to make this a mechanical change. I'll rename variables later, but I don't want to do that in this patch.

I am sorry but I really do not see why we would want to land this patch as is. Current situation is that SymbolBody is used everywhere and you are trying to rename it
to Symbol. That is good. Currently each place is known to need renaming, but naming of variables is also known to be correct.
After mechanical change you end up with set of places where each of them either correct or not, it is
set of Shroedinger's cats. Until you look on each you never know if it is correct or not, so to fix it you anyways will need to search for all Symbol lines in code again
and check for each place that code around uses proper variables naming. So I do not see how mechanical renaming helps to improve code.

I realize that doing such change manually is much more time consuming. And my suggestion is next.
If you want I can prepare renaming patch manually for LLD-ELF part and send on review.
It will be definetely better than this in my opinion at least because will fix obvious issues with naming things around changes.

ruiu added a comment.Nov 2 2017, 2:06 PM

Sorry Geroge, but I completely disagree with you. Renaming variables needs human judgement, and mixing it with a mechanical change is a bad idea. We really should submit this first and then rename variables in follow-up patches.

Making a variable renaming change prior to submitting this change doesn't make sense because you can easily get the idea what it would look like. Actually creating a patch just increases the amount of human labor work because I would need to maintain it during review, and it would be painful as it would conflict with a lot of other patches.

Please do not overthink about this patch. We really don't need any clever planning at the moment.

grimar accepted this revision.Nov 3 2017, 12:36 AM
In D39459#914495, @ruiu wrote:

Sorry Geroge, but I completely disagree with you. Renaming variables needs human judgement, and mixing it with a mechanical change is a bad idea. We really should submit this first and then rename variables in follow-up patches.

Making a variable renaming change prior to submitting this change doesn't make sense because you can easily get the idea what it would look like. Actually creating a patch just increases the amount of human labor work because I would need to maintain it during review, and it would be painful as it would conflict with a lot of other patches.

Please do not overthink about this patch. We really don't need any clever planning at the moment.

Ok. Probably I misunderstood the idea of this review. So if I correctly understand it now it was to show how renaming from SymbolBody to Symbol generally looks like in code.
New naming looks much better to me, so I would land it if looks OK for other reviewers.

This revision is now accepted and ready to land.Nov 3 2017, 12:36 AM
This revision was automatically updated to reflect the committed changes.