Fix MSVC warning.
authorRui Ueyama <ruiu@google.com>
Mon, 31 Mar 2014 20:04:37 +0000 (20:04 +0000)
committerRui Ueyama <ruiu@google.com>
Mon, 31 Mar 2014 20:04:37 +0000 (20:04 +0000)
This patch is to fix the following warning when compiled with MSVC 64 bit.

  warning C4334: '<<' : result of 32-bit shift implicitly converted to 64
  bits (was 64-bit shift intended?)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205245 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Allocator.h

index 916413247b405a8f3da0f82baf1df78b02f2060b..06413225a98522b336158fd038a1c20a5abf8b1e 100644 (file)
@@ -255,7 +255,7 @@ private:
     // size threshold. That will be fixed in a subsequent commit to make the
     // growth even more predictable.
     size_t AllocatedSlabSize =
-        SlabSize * (1 << std::min<size_t>(30, NumSlabs / 128));
+        SlabSize * ((size_t)1 << std::min<size_t>(30, NumSlabs / 128));
 
     MemSlab *NewSlab = Allocator.Allocate(AllocatedSlabSize);
     NewSlab->NextPtr = CurSlab;