From 056abd2059c65a3e908193aeae16fad98017437c Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 2 Dec 2012 13:20:44 +0000 Subject: Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2): http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974 --- include/clang/Basic/OnDiskHashTable.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include/clang/Basic/OnDiskHashTable.h') diff --git a/include/clang/Basic/OnDiskHashTable.h b/include/clang/Basic/OnDiskHashTable.h index 79273fc..cc9ca9f 100644 --- a/include/clang/Basic/OnDiskHashTable.h +++ b/include/clang/Basic/OnDiskHashTable.h @@ -65,8 +65,7 @@ inline void Emit64(raw_ostream& Out, uint64_t V) { inline void Pad(raw_ostream& Out, unsigned A) { Offset off = (Offset) Out.tell(); - uint32_t n = ((uintptr_t)(off+A-1) & ~(uintptr_t)(A-1)) - off; - for (; n ; --n) + for (uint32_t n = llvm::OffsetToAlignment(off, A); n; --n) Emit8(Out, 0); } @@ -102,7 +101,7 @@ inline uint64_t ReadUnalignedLE64(const unsigned char *&Data) { inline uint32_t ReadLE32(const unsigned char *&Data) { // Hosts that directly support little-endian 32-bit loads can just // use them. Big-endian hosts need a bswap. - uint32_t V = *((uint32_t*)Data); + uint32_t V = *((const uint32_t*)Data); if (llvm::sys::isBigEndianHost()) V = llvm::ByteSwap_32(V); Data += 4; -- cgit v1.1