Page MenuHomePhabricator

Rename InputSection.cpp:getSymVA to getRelocTargetVA.
ClosedPublic

Authored by silvas on Dec 14 2016, 2:28 PM.

Details

Reviewers
ruiu
Summary

This name was really confusing because there is also another static
helper Symbols.cpp:getSymVA which has the same name.

Any other naming suggestions are welcome. I just want to make it clear that this is different from Symbols.cpp:getSymVA. InputSection.cpp:getSymVA calls into Body.getVA which calls Symbols.cpp:getSymVA, so it also doesn't make much sense and makes the code harder to understand: they return different things, they should not be called get<the-same-thing>.

Diff Detail

Event Timeline

silvas updated this revision to Diff 81472.Dec 14 2016, 2:28 PM
silvas retitled this revision from to Rename InputSection.cpp:getSymVA to getTargetVA..
silvas updated this object.
silvas added a reviewer: ruiu.
silvas added a subscriber: llvm-commits.
davide added a subscriber: davide.Dec 14 2016, 2:34 PM

I am in favour of this change. I think the name is quite explanatory/clear.
Oracle docs (https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-54839.html) use the wording "storage unit affected by the reloc", but I prefer target =)

I am in favour of this change. I think the name is quite explanatory/clear.
Oracle docs (https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-54839.html) use the wording "storage unit affected by the reloc", but I prefer target =)

Not quite. "storage unit affected by the reloc" is the location that is being mutated by the relocation, not the thing the relocation "points at". Using the terminology from that page, I think the only term it uses is "value of the symbol whose index resides in the relocation entry" for RelocTarget.

ruiu accepted this revision.Dec 14 2016, 2:44 PM
ruiu edited edge metadata.

LGTM

This revision is now accepted and ready to land.Dec 14 2016, 2:44 PM

I am in favour of this change. I think the name is quite explanatory/clear.
Oracle docs (https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-54839.html) use the wording "storage unit affected by the reloc", but I prefer target =)

Not quite. "storage unit affected by the reloc" is the location that is being mutated by the relocation, not the thing the relocation "points at". Using the terminology from that page, I think the only term it uses is "value of the symbol whose index resides in the relocation entry" for RelocTarget.

Oh, yeah, nvm. LGTM anyway.

silvas updated this revision to Diff 81484.Dec 14 2016, 2:53 PM
silvas retitled this revision from Rename InputSection.cpp:getSymVA to getTargetVA. to Rename InputSection.cpp:getSymVA to getRelocTargetVA..
silvas edited edge metadata.

Update local variable name to be more consistent.

silvas closed this revision.Dec 14 2016, 2:57 PM

Committed in r289733