diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2010-01-22 03:33:01 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2010-01-22 03:33:01 +0000 |
| commit | 58c34c2c286bfc4fa95eba55beb175f277f956a0 (patch) | |
| tree | 62282e3c653384c88cd795abc64eb1c66c4efe8f | |
| parent | d2808449e4fc90d2594c009b978b8df4c94a7599 (diff) | |
| download | bcm5719-llvm-58c34c2c286bfc4fa95eba55beb175f277f956a0.tar.gz bcm5719-llvm-58c34c2c286bfc4fa95eba55beb175f277f956a0.zip | |
Add DenseMapInfo for signed long long.
llvm-svn: 94146
| -rw-r--r-- | llvm/include/llvm/ADT/DenseMapInfo.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/include/llvm/ADT/DenseMapInfo.h b/llvm/include/llvm/ADT/DenseMapInfo.h index 6b494ef5d03..41197a1e12d 100644 --- a/llvm/include/llvm/ADT/DenseMapInfo.h +++ b/llvm/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> > { |

