summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/DenseMapInfo.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-15 07:26:43 +0000
committerChris Lattner <sabre@nondot.org>2009-12-15 07:26:43 +0000
commit4bbf4ee1491637c247e195e19e3e4a8ee5ad72fa (patch)
treeb0abe4f45ba17d9284a9220034d62c9caae29db3 /include/llvm/ADT/DenseMapInfo.h
parentf8bc1e4b277dc85a89f93738d7de4d324a093fb4 (diff)
downloadllvm-4bbf4ee1491637c247e195e19e3e4a8ee5ad72fa.tar.gz
llvm-4bbf4ee1491637c247e195e19e3e4a8ee5ad72fa.tar.bz2
llvm-4bbf4ee1491637c247e195e19e3e4a8ee5ad72fa.tar.xz
Remove isPod() from DenseMapInfo, splitting it out to its own
isPodLike type trait. This is a generally useful type trait for more than just DenseMap, and we really care about whether something acts like a pod, not whether it really is a pod. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91421 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/DenseMapInfo.h')
-rw-r--r--include/llvm/ADT/DenseMapInfo.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/include/llvm/ADT/DenseMapInfo.h b/include/llvm/ADT/DenseMapInfo.h
index 2f241c514a..6b494ef5d0 100644
--- a/include/llvm/ADT/DenseMapInfo.h
+++ b/include/llvm/ADT/DenseMapInfo.h
@@ -15,7 +15,7 @@
#define LLVM_ADT_DENSEMAPINFO_H
#include "llvm/Support/PointerLikeTypeTraits.h"
-#include <utility>
+#include "llvm/Support/type_traits.h"
namespace llvm {
@@ -25,7 +25,6 @@ struct DenseMapInfo {
//static inline T getTombstoneKey();
//static unsigned getHashValue(const T &Val);
//static bool isEqual(const T &LHS, const T &RHS);
- //static bool isPod()
};
// Provide DenseMapInfo for all pointers.
@@ -46,7 +45,6 @@ struct DenseMapInfo<T*> {
(unsigned((uintptr_t)PtrVal) >> 9);
}
static bool isEqual(const T *LHS, const T *RHS) { return LHS == RHS; }
- static bool isPod() { return true; }
};
// Provide DenseMapInfo for chars.
@@ -54,7 +52,6 @@ template<> struct DenseMapInfo<char> {
static inline char getEmptyKey() { return ~0; }
static inline char getTombstoneKey() { return ~0 - 1; }
static unsigned getHashValue(const char& Val) { return Val * 37; }
- static bool isPod() { return true; }
static bool isEqual(const char &LHS, const char &RHS) {
return LHS == RHS;
}
@@ -65,7 +62,6 @@ template<> struct DenseMapInfo<unsigned> {
static inline unsigned getEmptyKey() { return ~0; }
static inline unsigned getTombstoneKey() { return ~0U - 1; }
static unsigned getHashValue(const unsigned& Val) { return Val * 37; }
- static bool isPod() { return true; }
static bool isEqual(const unsigned& LHS, const unsigned& RHS) {
return LHS == RHS;
}
@@ -78,7 +74,6 @@ template<> struct DenseMapInfo<unsigned long> {
static unsigned getHashValue(const unsigned long& Val) {
return (unsigned)(Val * 37UL);
}
- static bool isPod() { return true; }
static bool isEqual(const unsigned long& LHS, const unsigned long& RHS) {
return LHS == RHS;
}
@@ -91,7 +86,6 @@ template<> struct DenseMapInfo<unsigned long long> {
static unsigned getHashValue(const unsigned long long& Val) {
return (unsigned)(Val * 37ULL);
}
- static bool isPod() { return true; }
static bool isEqual(const unsigned long long& LHS,
const unsigned long long& RHS) {
return LHS == RHS;
@@ -127,7 +121,6 @@ struct DenseMapInfo<std::pair<T, U> > {
return (unsigned)key;
}
static bool isEqual(const Pair& LHS, const Pair& RHS) { return LHS == RHS; }
- static bool isPod() { return FirstInfo::isPod() && SecondInfo::isPod(); }
};
} // end namespace llvm