Page MenuHomePhabricator

[yaml2obj] - Convert `ELFState<ELFT>::addSymbols` method to `toELFSymbols` helper.
ClosedPublic

Authored by grimar on Tue, Jun 18, 6:56 AM.

Details

Summary

ELFState<ELFT>::addSymbols method looks a bit strange.
User code have to create the destination symbols vector outside,
add a null symbol and then pass it to addSymbols when it seems
the more natural logic is to isolate all work with symbols inside some
function, build the list right there and return it.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Tue, Jun 18, 6:56 AM
grimar edited the summary of this revision. (Show Details)Tue, Jun 18, 7:00 AM
jhenderson added inline comments.Wed, Jun 19, 4:05 AM
tools/yaml2obj/yaml2elf.cpp
383 ↗(On Diff #205327)

Do you need this? I think the vector resize will do this automatically, if I'm not mistaken.

grimar marked an inline comment as done.Wed, Jun 19, 4:21 AM
grimar added inline comments.
tools/yaml2obj/yaml2elf.cpp
383 ↗(On Diff #205327)

Yes, I think you're right. I'll remove this.

MaskRay accepted this revision.Wed, Jun 19, 6:12 AM
This revision is now accepted and ready to land.Wed, Jun 19, 6:12 AM
grimar updated this revision to Diff 205783.Thu, Jun 20, 5:10 AM
  • Removed memset.

James, are you happy with that version?

jhenderson accepted this revision.Thu, Jun 20, 5:43 AM

Yes, LGTM.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptThu, Jun 20, 7:44 AM