From: Douglas Katzman Date: Mon, 28 Mar 2016 19:23:23 +0000 (+0000) Subject: Use 'alignTo' instead of re-inventing it. NFC X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9825491bbdb5571a799a49ba2ae154dc1f636096;p=platform%2Fupstream%2Fllvm.git Use 'alignTo' instead of re-inventing it. NFC llvm-svn: 264623 --- diff --git a/llvm/include/llvm/Bitcode/BitstreamReader.h b/llvm/include/llvm/Bitcode/BitstreamReader.h index a7b1392..f664339 100644 --- a/llvm/include/llvm/Bitcode/BitstreamReader.h +++ b/llvm/include/llvm/Bitcode/BitstreamReader.h @@ -17,6 +17,7 @@ #include "llvm/Bitcode/BitCodes.h" #include "llvm/Support/Endian.h" +#include "llvm/Support/MathExtras.h" #include "llvm/Support/StreamingMemoryObject.h" #include #include @@ -366,8 +367,7 @@ public: assert(getCurrentByteNo() < Limit && "Move cursor before lowering limit"); // Round to word boundary. - if (Limit & (sizeof(word_t) - 1)) - Limit += sizeof(word_t) - Limit & (sizeof(word_t) - 1); + Limit = alignTo(Limit, sizeof(word_t)); // Only change size if the new one is lower. if (!Size || Size > Limit)