summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2018-07-27 16:01:09 +0000
committerFangrui Song <maskray@google.com>2018-07-27 16:01:09 +0000
commit9c85d7acbe29050cc38cc796960532d654bcec23 (patch)
tree0548ec63f7fb82fd1fe262b43ef10054c5c8b341 /llvm/lib
parent6ff58ed5ca6f9e964592c11af5aae9e4f9b39ab5 (diff)
downloadbcm5719-llvm-9c85d7acbe29050cc38cc796960532d654bcec23.tar.gz
bcm5719-llvm-9c85d7acbe29050cc38cc796960532d654bcec23.zip
[Support] Use unsigned char for xxHash 64-bit
Before, the last 3 bytes were char-signedness dependent. llvm-svn: 338128
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Support/xxhash.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Support/xxhash.cpp b/llvm/lib/Support/xxhash.cpp
index a7d990bf6a4..df643f9bd63 100644
--- a/llvm/lib/Support/xxhash.cpp
+++ b/llvm/lib/Support/xxhash.cpp
@@ -71,12 +71,12 @@ static uint64_t mergeRound(uint64_t Acc, uint64_t Val) {
uint64_t llvm::xxHash64(StringRef Data) {
size_t Len = Data.size();
uint64_t Seed = 0;
- const char *P = Data.data();
- const char *const BEnd = P + Len;
+ const unsigned char *P = Data.bytes_begin();
+ const unsigned char *const BEnd = Data.bytes_end();
uint64_t H64;
if (Len >= 32) {
- const char *const Limit = BEnd - 32;
+ const unsigned char *const Limit = BEnd - 32;
uint64_t V1 = Seed + PRIME64_1 + PRIME64_2;
uint64_t V2 = Seed + PRIME64_2;
uint64_t V3 = Seed + 0;
OpenPOWER on IntegriCloud