diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-04-18 20:27:24 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-04-18 20:27:24 +0000 |
commit | 25463f15771d18a863838d099716eba631a51b65 (patch) | |
tree | 6d550edec81058d8801ebc509f2e74de20c18ec9 /clang/lib/Serialization/GlobalModuleIndex.cpp | |
parent | be0a7ac5e85b893d8837b81440082212dc144769 (diff) | |
download | bcm5719-llvm-25463f15771d18a863838d099716eba631a51b65.tar.gz bcm5719-llvm-25463f15771d18a863838d099716eba631a51b65.zip |
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.
llvm-svn: 206640
Diffstat (limited to 'clang/lib/Serialization/GlobalModuleIndex.cpp')
-rw-r--r-- | clang/lib/Serialization/GlobalModuleIndex.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp index 1649476342b..21a714999b0 100644 --- a/clang/lib/Serialization/GlobalModuleIndex.cpp +++ b/clang/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); } |