summaryrefslogtreecommitdiff
path: root/lib/Serialization/GlobalModuleIndex.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-04-18 20:27:24 +0000
committerJustin Bogner <mail@justinbogner.com>2014-04-18 20:27:24 +0000
commitf4a4206c265fa656dc93f22822ee6a63b55ac542 (patch)
tree4c2ca8454491e21db915a5bba6f0cf24b8d4696e /lib/Serialization/GlobalModuleIndex.cpp
parent87be603c1b19f691bcb8579d74f9812ff8797026 (diff)
downloadclang-f4a4206c265fa656dc93f22822ee6a63b55ac542.tar.gz
clang-f4a4206c265fa656dc93f22822ee6a63b55ac542.tar.bz2
clang-f4a4206c265fa656dc93f22822ee6a63b55ac542.tar.xz
Teach users of OnDiskHashTable to define hash_value and offset types
This paves the way to making OnDiskHashTable work with hashes that are not 32 bits wide and to making OnDiskHashTable work very large hash tables. The LLVM change to use these types is upcoming. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206640 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/GlobalModuleIndex.cpp')
-rw-r--r--lib/Serialization/GlobalModuleIndex.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Serialization/GlobalModuleIndex.cpp b/lib/Serialization/GlobalModuleIndex.cpp
index 1649476342..21a714999b 100644
--- a/lib/Serialization/GlobalModuleIndex.cpp
+++ b/lib/Serialization/GlobalModuleIndex.cpp
@@ -72,12 +72,14 @@ public:
typedef StringRef external_key_type;
typedef StringRef internal_key_type;
typedef SmallVector<unsigned, 2> data_type;
+ typedef unsigned hash_value_type;
+ typedef unsigned offset_type;
static bool EqualKey(const internal_key_type& a, const internal_key_type& b) {
return a == b;
}
- static unsigned ComputeHash(const internal_key_type& a) {
+ static hash_value_type ComputeHash(const internal_key_type& a) {
return llvm::HashString(a);
}
@@ -645,8 +647,10 @@ public:
typedef StringRef key_type_ref;
typedef SmallVector<unsigned, 2> data_type;
typedef const SmallVector<unsigned, 2> &data_type_ref;
+ typedef unsigned hash_value_type;
+ typedef unsigned offset_type;
- static unsigned ComputeHash(key_type_ref Key) {
+ static hash_value_type ComputeHash(key_type_ref Key) {
return llvm::HashString(Key);
}