IR: Replace DataLayout::RoundUpAlignment with RoundUpToAlignment

No functional change intended, just cleaning up some code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220187 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer
2014-10-20 06:13:33 +00:00
parent 080dfb5bda
commit 7798534e77
5 changed files with 11 additions and 20 deletions

View File

@ -597,7 +597,8 @@ inline uint64_t PowerOf2Floor(uint64_t A) {
/// RoundUpToAlignment(~0LL, 8) = 0
/// \endcode
inline uint64_t RoundUpToAlignment(uint64_t Value, uint64_t Align) {
return ((Value + Align - 1) / Align) * Align;
assert(isPowerOf2_64(Align) && "Alignment must be power of 2!");
return (Value + Align - 1) & ~uint64_t(Align - 1);
}
/// Returns the offset to the next integer (mod 2**64) that is greater than