aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/DenseMapInfo.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-01-22 03:33:01 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-01-22 03:33:01 +0000
commitcf220d5b8955a71d364a0a054e8518197bf6df32 (patch)
tree2c60a4ec6dee5ba04842cf23a15f91ab067206ec /include/llvm/ADT/DenseMapInfo.h
parent4bd8dc39fb5c26326f644f77d82e0df30893a244 (diff)
downloadexternal_llvm-cf220d5b8955a71d364a0a054e8518197bf6df32.zip
external_llvm-cf220d5b8955a71d364a0a054e8518197bf6df32.tar.gz
external_llvm-cf220d5b8955a71d364a0a054e8518197bf6df32.tar.bz2
Add DenseMapInfo for signed long long.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94146 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/DenseMapInfo.h')
-rw-r--r--include/llvm/ADT/DenseMapInfo.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/ADT/DenseMapInfo.h b/include/llvm/ADT/DenseMapInfo.h
index 6b494ef..41197a1 100644
--- a/include/llvm/ADT/DenseMapInfo.h
+++ b/include/llvm/ADT/DenseMapInfo.h
@@ -92,6 +92,19 @@ template<> struct DenseMapInfo<unsigned long long> {
}
};
+// Provide DenseMapInfo for long longs.
+template<> struct DenseMapInfo<long long> {
+ static inline long long getEmptyKey() { return 0x7fffffffffffffffLL; }
+ static inline long long getTombstoneKey() { return -0x7fffffffffffffffLL-1; }
+ static unsigned getHashValue(const long long& Val) {
+ return (unsigned)(Val * 37LL);
+ }
+ static bool isEqual(const long long& LHS,
+ const long long& RHS) {
+ return LHS == RHS;
+ }
+};
+
// Provide DenseMapInfo for all pairs whose members have info.
template<typename T, typename U>
struct DenseMapInfo<std::pair<T, U> > {