[llvm-commits] [llvm] r152021 - /llvm/trunk/include/llvm/ADT/Hashing.h

Chandler Carruth chandlerc at gmail.com
Mon Mar 5 01:56:13 PST 2012


Author: chandlerc
Date: Mon Mar  5 03:56:12 2012
New Revision: 152021

URL: http://llvm.org/viewvc/llvm-project?rev=152021&view=rev
Log:
Switch to a C-style cast here to silence a brain-dead MSVC warning. It
complains about the truncation of a 64-bit constant to a 32-bit value
when size_t is 32-bits wide, but *only with static_cast*!!! The exact
signal that should *silence* such a warning, and in fact does silence it
with both GCC and Clang.

Anyways, this was causing grief for all the MSVC builds, so pointless
change made. Thanks to Nikola on IRC for confirming that this works.

Modified:
    llvm/trunk/include/llvm/ADT/Hashing.h

Modified: llvm/trunk/include/llvm/ADT/Hashing.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Hashing.h?rev=152021&r1=152020&r2=152021&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Hashing.h (original)
+++ llvm/trunk/include/llvm/ADT/Hashing.h Mon Mar  5 03:56:12 2012
@@ -338,7 +338,7 @@
   // called, return that instead of the per-execution seed.
   const uint64_t seed_prime = 0xff51afd7ed558ccdULL;
   static size_t seed = fixed_seed_override ? fixed_seed_override
-                                           : static_cast<size_t>(seed_prime);
+                                           : (size_t)seed_prime;
   return seed;
 }
 





More information about the llvm-commits mailing list