llvm-dwp: Simplify hashing code a bit

llvm-svn: 265426
This commit is contained in:
David Blaikie 2016-04-05 17:51:40 +00:00
parent d2f44d8de0
commit 9b49256fa8
1 changed files with 2 additions and 1 deletions

View File

@ -288,10 +288,11 @@ writeIndex(MCStreamer &Out, MCSection *Section,
for (const auto &P : IndexEntries) {
auto S = P.first;
auto H = S & Mask;
auto HP = ((S >> 32) & Mask) | 1;
while (Buckets[H]) {
assert(S != IndexEntries.begin()[Buckets[H] - 1].first &&
"Duplicate unit");
H = (H + (((S >> 32) & Mask) | 1)) % Buckets.size();
H = (H + HP) & Mask;
}
Buckets[H] = i + 1;
++i;