OSDN Git Service

Make ICF log output order deterministic.
authorRui Ueyama <ruiu@google.com>
Tue, 31 Jul 2018 18:04:58 +0000 (18:04 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 31 Jul 2018 18:04:58 +0000 (18:04 +0000)
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
lib/Support/xxhash.cpp

index f7ca460..6fd67ff 100644 (file)
 #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<uint8_t> Data);
 }
 
 #endif
index df643f9..e9dceed 100644 (file)
@@ -132,3 +132,7 @@ uint64_t llvm::xxHash64(StringRef Data) {
 
   return H64;
 }
+
+uint64_t llvm::xxHash64(ArrayRef<uint8_t> Data) {
+  return xxHash64({(const char *)Data.data(), Data.size()});
+}