llvm.org GIT mirror llvm / 1c60993
ProfileData: Don't forward declare ComputeHash and make it static inline git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206663 91177308-0d34-0410-b5e6-96231b3b80d8 Justin Bogner 6 years ago
3 changed file(s) with 7 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
197197
198198 namespace IndexedInstrProf {
199199 enum class HashT : uint32_t;
200 uint64_t ComputeHash(HashT Type, StringRef K);
201200 }
202201
203202 /// Trait for lookups into the on-disk hash table for the binary instrprof
217216 static bool EqualKey(StringRef A, StringRef B) { return A == B; }
218217 static StringRef GetInternalKey(StringRef K) { return K; }
219218
220 hash_value_type ComputeHash(StringRef K) {
221 return IndexedInstrProf::ComputeHash(HashType, K);
222 }
219 hash_value_type ComputeHash(StringRef K);
223220
224221 static std::pair
225222 ReadKeyDataLength(const unsigned char *&D) {
3535 return endian::read(Result);
3636 }
3737
38 uint64_t ComputeHash(HashT Type, StringRef K) {
38 static inline uint64_t ComputeHash(HashT Type, StringRef K) {
3939 switch (Type) {
4040 case HashT::MD5:
4141 return IndexedInstrProf::MD5Hash(K);
242242 template class RawInstrProfReader;
243243 }
244244
245 InstrProfLookupTrait::hash_value_type
246 InstrProfLookupTrait::ComputeHash(StringRef K) {
247 return IndexedInstrProf::ComputeHash(HashType, K);
248 }
249
245250 bool IndexedInstrProfReader::hasFormat(const MemoryBuffer &DataBuffer) {
246251 if (DataBuffer.getBufferSize() < 8)
247252 return false;