From: Evan Cheng Date: Fri, 22 Jan 2010 03:33:01 +0000 (+0000) Subject: Add DenseMapInfo for signed long long. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=cf220d5b8955a71d364a0a054e8518197bf6df32;p=oota-llvm.git Add DenseMapInfo for signed long long. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94146 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/DenseMapInfo.h b/include/llvm/ADT/DenseMapInfo.h index 6b494ef5d03..41197a1e12d 100644 --- a/include/llvm/ADT/DenseMapInfo.h +++ b/include/llvm/ADT/DenseMapInfo.h @@ -92,6 +92,19 @@ template<> struct DenseMapInfo { } }; +// Provide DenseMapInfo for long longs. +template<> struct DenseMapInfo { + 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 struct DenseMapInfo > {