[PGO] Simplify computehash interface (NFC)
authorXinliang David Li <davidxl@google.com>
Fri, 18 Dec 2015 22:22:12 +0000 (22:22 +0000)
committerXinliang David Li <davidxl@google.com>
Fri, 18 Dec 2015 22:22:12 +0000 (22:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256047 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ProfileData/InstrProf.h
lib/ProfileData/InstrProf.cpp
lib/ProfileData/InstrProfWriter.cpp

index 6e813e24eb8aca053136e0a52c2a4524a5730e47..365656bb9d2ca1eb32b47beba6cb36a8f2577076 100644 (file)
@@ -575,6 +575,10 @@ const uint64_t Magic = 0x8169666f72706cff; // "\xfflprofi\x81"
 const uint64_t Version = INSTR_PROF_INDEX_VERSION;
 const HashT HashType = HashT::MD5;
 
+static inline uint64_t ComputeHash(StringRef K) {
+  return ComputeHash(HashType, K);
+}
+
 // This structure defines the file header of the LLVM profile
 // data file in indexed-format.
 struct Header {
index 00c9057c8b45bf9437bbb0cc653202a78db7482e..10ba68c41d158b6f5ec090284ad6cd1ea226d316 100644 (file)
@@ -201,8 +201,7 @@ void getValueForSiteInstrProf(const void *R, InstrProfValueData *Dst,
 uint64_t stringToHash(uint32_t ValueKind, uint64_t Value) {
   switch (ValueKind) {
   case IPVK_IndirectCallTarget:
-    return IndexedInstrProf::ComputeHash(IndexedInstrProf::HashType,
-                                         (const char *)Value);
+    return IndexedInstrProf::ComputeHash((const char *)Value);
     break;
   default:
     llvm_unreachable("value kind not handled !");
index 478cf80db7a05f1cd8109d69bc29573f235bd92e..2f4ef08290616df5f24a28dfec209cc3820d3b5a 100644 (file)
@@ -35,7 +35,7 @@ public:
   typedef uint64_t offset_type;
 
   static hash_value_type ComputeHash(key_type_ref K) {
-    return IndexedInstrProf::ComputeHash(IndexedInstrProf::HashType, K);
+    return IndexedInstrProf::ComputeHash(K);
   }
 
   static std::pair<offset_type, offset_type>