This is an archive of the discontinued LLVM Phabricator instance.

[Support] Rename RoundUpToAlignment -> align.
ClosedPublic

Authored by ruiu on Jan 13 2016, 3:59 PM.

Details

Reviewers
davidxl
Summary

Rounding up an integer m to a nearest multiple of n where n is a power
of 2 is used very often if you are writing code to emit binary files.
RoundUpToAlignment is a small function to do that. But we found that the
function has a small but annoying issue; the name is a bit too long.
Because it is used quite often, that hurts readability.

This patch is to rename the function. The original name is kept as a
forwarder, so that submitting this patch won't immediately break Clang
and other LLVM projects. Once I update all occurrences of RoundUpToAlignment,
I'll remove the old name entirely.

Diff Detail

Event Timeline

ruiu updated this revision to Diff 44808.Jan 13 2016, 3:59 PM
ruiu retitled this revision from to [Support] Rename RoundUpToAlignment -> align..
ruiu updated this object.
ruiu added reviewers: davidxl, silvas.
ruiu added a subscriber: llvm-commits.
davidxl accepted this revision.Jan 13 2016, 4:15 PM
davidxl edited edge metadata.

I could not think of a better and similarly short name -- LGTM.

This revision is now accepted and ready to land.Jan 13 2016, 4:15 PM

I'd suggest alignTo

ruiu updated this revision to Diff 44814.Jan 13 2016, 4:42 PM
ruiu edited edge metadata.
  • Renamed alignTo
silvas resigned from this revision.Jul 8 2016, 11:46 PM
silvas removed a reviewer: silvas.