This repository was archived by the owner on Feb 5, 2019. It is now read-only.
File tree 3 files changed +7
-5
lines changed
3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -198,7 +198,6 @@ typedef RawInstrProfReader<uint64_t> RawInstrProfReader64;
198
198
199
199
namespace IndexedInstrProf {
200
200
enum class HashT : uint32_t ;
201
- uint64_t ComputeHash (HashT Type, StringRef K);
202
201
}
203
202
204
203
// / Trait for lookups into the on-disk hash table for the binary instrprof
@@ -218,9 +217,7 @@ class InstrProfLookupTrait {
218
217
static bool EqualKey (StringRef A, StringRef B) { return A == B; }
219
218
static StringRef GetInternalKey (StringRef K) { return K; }
220
219
221
- hash_value_type ComputeHash (StringRef K) {
222
- return IndexedInstrProf::ComputeHash (HashType, K);
223
- }
220
+ hash_value_type ComputeHash (StringRef K);
224
221
225
222
static std::pair<offset_type, offset_type>
226
223
ReadKeyDataLength (const unsigned char *&D) {
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ static inline uint64_t MD5Hash(StringRef Str) {
36
36
return endian::read <uint64_t , little, unaligned>(Result);
37
37
}
38
38
39
- uint64_t ComputeHash (HashT Type, StringRef K) {
39
+ static inline uint64_t ComputeHash (HashT Type, StringRef K) {
40
40
switch (Type) {
41
41
case HashT::MD5:
42
42
return IndexedInstrProf::MD5Hash (K);
Original file line number Diff line number Diff line change @@ -243,6 +243,11 @@ template class RawInstrProfReader<uint32_t>;
243
243
template class RawInstrProfReader <uint64_t >;
244
244
}
245
245
246
+ InstrProfLookupTrait::hash_value_type
247
+ InstrProfLookupTrait::ComputeHash (StringRef K) {
248
+ return IndexedInstrProf::ComputeHash (HashType, K);
249
+ }
250
+
246
251
bool IndexedInstrProfReader::hasFormat (const MemoryBuffer &DataBuffer) {
247
252
if (DataBuffer.getBufferSize () < 8 )
248
253
return false ;
You can’t perform that action at this time.
0 commit comments