forked from OSchip/llvm-project
ProfileData: Don't forward declare ComputeHash and make it static inline
llvm-svn: 206663
This commit is contained in:
parent
f00daf15f0
commit
b5d368e838
|
@ -198,7 +198,6 @@ typedef RawInstrProfReader<uint64_t> RawInstrProfReader64;
|
||||||
|
|
||||||
namespace IndexedInstrProf {
|
namespace IndexedInstrProf {
|
||||||
enum class HashT : uint32_t;
|
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
|
/// Trait for lookups into the on-disk hash table for the binary instrprof
|
||||||
|
@ -218,9 +217,7 @@ public:
|
||||||
static bool EqualKey(StringRef A, StringRef B) { return A == B; }
|
static bool EqualKey(StringRef A, StringRef B) { return A == B; }
|
||||||
static StringRef GetInternalKey(StringRef K) { return K; }
|
static StringRef GetInternalKey(StringRef K) { return K; }
|
||||||
|
|
||||||
hash_value_type ComputeHash(StringRef K) {
|
hash_value_type ComputeHash(StringRef K);
|
||||||
return IndexedInstrProf::ComputeHash(HashType, K);
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::pair<offset_type, offset_type>
|
static std::pair<offset_type, offset_type>
|
||||||
ReadKeyDataLength(const unsigned char *&D) {
|
ReadKeyDataLength(const unsigned char *&D) {
|
||||||
|
|
|
@ -36,7 +36,7 @@ static inline uint64_t MD5Hash(StringRef Str) {
|
||||||
return endian::read<uint64_t, little, unaligned>(Result);
|
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) {
|
switch (Type) {
|
||||||
case HashT::MD5:
|
case HashT::MD5:
|
||||||
return IndexedInstrProf::MD5Hash(K);
|
return IndexedInstrProf::MD5Hash(K);
|
||||||
|
|
|
@ -243,6 +243,11 @@ template class RawInstrProfReader<uint32_t>;
|
||||||
template class RawInstrProfReader<uint64_t>;
|
template class RawInstrProfReader<uint64_t>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InstrProfLookupTrait::hash_value_type
|
||||||
|
InstrProfLookupTrait::ComputeHash(StringRef K) {
|
||||||
|
return IndexedInstrProf::ComputeHash(HashType, K);
|
||||||
|
}
|
||||||
|
|
||||||
bool IndexedInstrProfReader::hasFormat(const MemoryBuffer &DataBuffer) {
|
bool IndexedInstrProfReader::hasFormat(const MemoryBuffer &DataBuffer) {
|
||||||
if (DataBuffer.getBufferSize() < 8)
|
if (DataBuffer.getBufferSize() < 8)
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue