This is an archive of the discontinued LLVM Phabricator instance.

Inline applyRelocations into writeTo.
ClosedPublic

Authored by ruiu on Feb 19 2018, 2:51 PM.

Details

Reviewers
sbc100
Summary

writeTo is memcpy() and applyRelocations(), but the former part is
too small that it doesn't make much sense to split it into two.

Event Timeline

ruiu created this revision.Feb 19 2018, 2:51 PM
sbc100 accepted this revision.Feb 19 2018, 4:30 PM

This doesn't seem strictly better to me. Seems like it only increases the complexity and the indentations of the code, and while decreasing re-usability. Is there a specific benefit? Shouldn't we prefer shorter and less nested functions?

This revision is now accepted and ready to land.Feb 19 2018, 4:30 PM
ruiu closed this revision.Feb 19 2018, 8:39 PM

The patch to remove OutRelocation also contained this change, so this change was submitted as part of that. I do prefer shorter functions, but in this case it feels to me that writeTo does too less. That's probably a personal preference though.