[llvm] r338406 - Make ICF log output order deterministic.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 11:04:59 PDT 2018


Author: ruiu
Date: Tue Jul 31 11:04:58 2018
New Revision: 338406

URL: http://llvm.org/viewvc/llvm-project?rev=338406&view=rev
Log:
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

Modified:
    llvm/trunk/include/llvm/Support/xxhash.h
    llvm/trunk/lib/Support/xxhash.cpp

Modified: llvm/trunk/include/llvm/Support/xxhash.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/xxhash.h?rev=338406&r1=338405&r2=338406&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/xxhash.h (original)
+++ llvm/trunk/include/llvm/Support/xxhash.h Tue Jul 31 11:04:58 2018
@@ -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<uint8_t> Data);
 }
 
 #endif

Modified: llvm/trunk/lib/Support/xxhash.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/xxhash.cpp?rev=338406&r1=338405&r2=338406&view=diff
==============================================================================
--- llvm/trunk/lib/Support/xxhash.cpp (original)
+++ llvm/trunk/lib/Support/xxhash.cpp Tue Jul 31 11:04:58 2018
@@ -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()});
+}




More information about the llvm-commits mailing list