diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-03-04 10:55:27 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-03-04 10:55:27 +0000 |
commit | 528f0bbe19553dfadedca040df13a389daa7593d (patch) | |
tree | 77a3d2c6552856db2c37e33ceb865c4ac18adda0 /lib/Support | |
parent | e3e394d982a2bd2bc37edb1f8c3492d0382e37a9 (diff) | |
download | external_llvm-528f0bbe19553dfadedca040df13a389daa7593d.zip external_llvm-528f0bbe19553dfadedca040df13a389daa7593d.tar.gz external_llvm-528f0bbe19553dfadedca040df13a389daa7593d.tar.bz2 |
Add generic support for hashing StringRef objects using the new hashing library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152003 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/StringRef.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Support/StringRef.cpp b/lib/Support/StringRef.cpp index 44e7325..1c28bf8 100644 --- a/lib/Support/StringRef.cpp +++ b/lib/Support/StringRef.cpp @@ -10,6 +10,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/OwningPtr.h" +#include "llvm/ADT/Hashing.h" #include "llvm/ADT/edit_distance.h" #include <bitset> @@ -447,3 +448,9 @@ bool StringRef::getAsInteger(unsigned Radix, APInt &Result) const { return false; } + + +// Implementation of StringRef hashing. +hash_code llvm::hash_value(StringRef S) { + return hash_combine_range(S.begin(), S.end()); +} |