Teach more users of OnDiskHashTable to define hash_value and offset types

I'd missed a few of these on the first pass. This should get the
builds going again.

Swift SVN r16570
This commit is contained in:
Justin Bogner
2014-04-19 18:36:45 +00:00
parent 0043652979
commit c7070b0ac2
2 changed files with 9 additions and 3 deletions

View File

@@ -57,12 +57,14 @@ public:
using internal_key_type = StringRef; using internal_key_type = StringRef;
using external_key_type = StringRef; using external_key_type = StringRef;
using data_type = DeclID; using data_type = DeclID;
using hash_value_type = uint32_t;
using offset_type = unsigned;
internal_key_type GetInternalKey(external_key_type ID) { return ID; } internal_key_type GetInternalKey(external_key_type ID) { return ID; }
external_key_type GetExternalKey(internal_key_type ID) { return ID; } external_key_type GetExternalKey(internal_key_type ID) { return ID; }
uint32_t ComputeHash(internal_key_type key) { hash_value_type ComputeHash(internal_key_type key) {
return llvm::HashString(key); return llvm::HashString(key);
} }

View File

@@ -199,12 +199,14 @@ public:
using internal_key_type = StringRef; using internal_key_type = StringRef;
using external_key_type = Identifier; using external_key_type = Identifier;
using data_type = SmallVector<std::pair<uint8_t, DeclID>, 8>; using data_type = SmallVector<std::pair<uint8_t, DeclID>, 8>;
using hash_value_type = uint32_t;
using offset_type = unsigned;
internal_key_type GetInternalKey(external_key_type ID) { internal_key_type GetInternalKey(external_key_type ID) {
return ID.str(); return ID.str();
} }
uint32_t ComputeHash(internal_key_type key) { hash_value_type ComputeHash(internal_key_type key) {
return llvm::HashString(key); return llvm::HashString(key);
} }
@@ -376,6 +378,8 @@ public:
using internal_key_type = StringRef; using internal_key_type = StringRef;
using external_key_type = StringRef; using external_key_type = StringRef;
using data_type = BriefAndRawComment; using data_type = BriefAndRawComment;
using hash_value_type = uint32_t;
using offset_type = unsigned;
DeclCommentTableInfo(ModuleFile &F) : F(F) {} DeclCommentTableInfo(ModuleFile &F) : F(F) {}
@@ -383,7 +387,7 @@ public:
return key; return key;
} }
uint32_t ComputeHash(internal_key_type key) { hash_value_type ComputeHash(internal_key_type key) {
assert(!key.empty()); assert(!key.empty());
return llvm::HashString(key); return llvm::HashString(key);
} }