From 25463f15771d18a863838d099716eba631a51b65 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Fri, 18 Apr 2014 20:27:24 +0000 Subject: 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 --- clang/lib/Serialization/GlobalModuleIndex.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'clang/lib/Serialization/GlobalModuleIndex.cpp') 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 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 data_type; typedef const SmallVector &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); } -- cgit v1.2.3