[llvm] r261071 - Fix the hash function.
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 16 23:00:22 PST 2016
Author: dblaikie
Date: Wed Feb 17 01:00:22 2016
New Revision: 261071
URL: http://llvm.org/viewvc/llvm-project?rev=261071&view=rev
Log:
Fix the hash function.
Modified:
llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
Modified: llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp?rev=261071&r1=261070&r2=261071&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp (original)
+++ llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp Wed Feb 17 01:00:22 2016
@@ -203,7 +203,7 @@ static void writeIndex(MCStreamer &Out,
while (Buckets[H]) {
assert(S != IndexEntries[Buckets[H] - 1].Signature &&
"Duplicate type unit");
- H += ((S >> 32) & Mask) | 1;
+ H = (H + ((S >> 32) & Mask) | 1) % Buckets.size();
}
Buckets[H] = i + 1;
}
More information about the llvm-commits
mailing list