From f1cbb93050f1f295af6a4e5bb53dd99d48b2d4ed Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 6 Jan 2016 23:34:12 +0000 Subject: [PATCH] Use RoundUpToAlignment instead of writing the expression to round up. The original code might be more readable than the new one if you remember the expression. Otherwise the new one is probably better. llvm-svn: 256995 --- lld/ELF/OutputSections.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h index 4e2591311546..ef9c945b5b98 100644 --- a/lld/ELF/OutputSections.h +++ b/lld/ELF/OutputSections.h @@ -433,7 +433,7 @@ private: }; inline uint64_t align(uint64_t Value, uint64_t Align) { - return (Value + Align - 1) & ~(Align - 1); + return llvm::RoundUpToAlignment(Value, Align); } // All output sections that are hadnled by the linker specially are