[llvm] r290068 - [PDB] Don't use the long type

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 18 12:10:50 PST 2016


Author: majnemer
Date: Sun Dec 18 14:10:50 2016
New Revision: 290068

URL: http://llvm.org/viewvc/llvm-project?rev=290068&view=rev
Log:
[PDB] Don't use the long type

Long is not the same size across a number of the platforms we support.
Use unsigned int here instead, it is more appropriate because
overflow/wrap-around is possible and, in this case, expected.

Modified:
    llvm/trunk/lib/DebugInfo/PDB/Raw/Hash.cpp

Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/Hash.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/Hash.cpp?rev=290068&r1=290067&r2=290068&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Raw/Hash.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Raw/Hash.cpp Sun Dec 18 14:10:50 2016
@@ -74,7 +74,7 @@ uint32_t pdb::hashStringV2(StringRef Str
     Hash ^= (Hash >> 6);
   }
 
-  return Hash * 1664525L + 1013904223L;
+  return Hash * 1664525U + 1013904223U;
 }
 
 // Corresponds to `SigForPbCb` in langapi/shared/crc32.h.




More information about the llvm-commits mailing list