namespace IndexedInstrProf {
enum class HashT : uint32_t;
-uint64_t ComputeHash(HashT Type, StringRef K);
}
/// Trait for lookups into the on-disk hash table for the binary instrprof
static bool EqualKey(StringRef A, StringRef B) { return A == B; }
static StringRef GetInternalKey(StringRef K) { return K; }
- hash_value_type ComputeHash(StringRef K) {
- return IndexedInstrProf::ComputeHash(HashType, K);
- }
+ hash_value_type ComputeHash(StringRef K);
static std::pair<offset_type, offset_type>
ReadKeyDataLength(const unsigned char *&D) {
return endian::read<uint64_t, little, unaligned>(Result);
}
-uint64_t ComputeHash(HashT Type, StringRef K) {
+static inline uint64_t ComputeHash(HashT Type, StringRef K) {
switch (Type) {
case HashT::MD5:
return IndexedInstrProf::MD5Hash(K);
template class RawInstrProfReader<uint64_t>;
}
+InstrProfLookupTrait::hash_value_type
+InstrProfLookupTrait::ComputeHash(StringRef K) {
+ return IndexedInstrProf::ComputeHash(HashType, K);
+}
+
bool IndexedInstrProfReader::hasFormat(const MemoryBuffer &DataBuffer) {
if (DataBuffer.getBufferSize() < 8)
return false;