aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-03-04 10:55:27 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-03-04 10:55:27 +0000
commit528f0bbe19553dfadedca040df13a389daa7593d (patch)
tree77a3d2c6552856db2c37e33ceb865c4ac18adda0 /include/llvm/ADT
parente3e394d982a2bd2bc37edb1f8c3492d0382e37a9 (diff)
downloadexternal_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 'include/llvm/ADT')
-rw-r--r--include/llvm/ADT/StringRef.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/ADT/StringRef.h b/include/llvm/ADT/StringRef.h
index 53ebe6a..a2bb7fe 100644
--- a/include/llvm/ADT/StringRef.h
+++ b/include/llvm/ADT/StringRef.h
@@ -19,6 +19,7 @@ namespace llvm {
template<typename T>
class SmallVectorImpl;
class APInt;
+ class hash_code;
/// StringRef - Represent a constant reference to a string, i.e. a character
/// array and a length, which need not be null terminated.
@@ -490,6 +491,9 @@ namespace llvm {
/// @}
+ /// \brief Compute a hash_code for a StringRef.
+ hash_code hash_value(StringRef S);
+
// StringRefs can be treated like a POD type.
template <typename T> struct isPodLike;
template <> struct isPodLike<StringRef> { static const bool value = true; };