summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2016-04-05 17:51:40 +0000
committerDavid Blaikie <dblaikie@gmail.com>2016-04-05 17:51:40 +0000
commit9b49256fa83e33a93f8c0dd7dc11761d5a2ae147 (patch)
tree67c2759be1784490c73bf86c63ab47be3892d21b /llvm/tools
parentd2f44d8de01a635e197b3ad4dcafdab5f2b4408a (diff)
downloadbcm5719-llvm-9b49256fa83e33a93f8c0dd7dc11761d5a2ae147.tar.gz
bcm5719-llvm-9b49256fa83e33a93f8c0dd7dc11761d5a2ae147.zip
llvm-dwp: Simplify hashing code a bit
llvm-svn: 265426
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/llvm-dwp/llvm-dwp.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp
index 9fa22dcae3e..737e396ed74 100644
--- a/llvm/tools/llvm-dwp/llvm-dwp.cpp
+++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp
@@ -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;
OpenPOWER on IntegriCloud