From 2c3c78e685eeaed179014d9d5fc6e279ca28b70a Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 31 Jul 2018 18:04:58 +0000 Subject: [PATCH] Make ICF log output order deterministic. This patch does the same thing as r338153 for COFF. Note that this patch affects only the order of log messages. The output file is already deterministic. Differential Revision: https://reviews.llvm.org/D50023 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338406 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/xxhash.h | 2 ++ lib/Support/xxhash.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/llvm/Support/xxhash.h b/include/llvm/Support/xxhash.h index f7ca460188a..6fd67ff9ce1 100644 --- a/include/llvm/Support/xxhash.h +++ b/include/llvm/Support/xxhash.h @@ -38,10 +38,12 @@ #ifndef LLVM_SUPPORT_XXHASH_H #define LLVM_SUPPORT_XXHASH_H +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" namespace llvm { uint64_t xxHash64(llvm::StringRef Data); +uint64_t xxHash64(llvm::ArrayRef Data); } #endif diff --git a/lib/Support/xxhash.cpp b/lib/Support/xxhash.cpp index df643f9bd63..e9dceed2c4a 100644 --- a/lib/Support/xxhash.cpp +++ b/lib/Support/xxhash.cpp @@ -132,3 +132,7 @@ uint64_t llvm::xxHash64(StringRef Data) { return H64; } + +uint64_t llvm::xxHash64(ArrayRef Data) { + return xxHash64({(const char *)Data.data(), Data.size()}); +} -- 2.50.1