diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-15 07:26:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-15 07:26:43 +0000 |
commit | 4bbf4ee1491637c247e195e19e3e4a8ee5ad72fa (patch) | |
tree | b0abe4f45ba17d9284a9220034d62c9caae29db3 /include/llvm/ADT/PointerIntPair.h | |
parent | f8bc1e4b277dc85a89f93738d7de4d324a093fb4 (diff) | |
download | llvm-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/PointerIntPair.h')
-rw-r--r-- | include/llvm/ADT/PointerIntPair.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/ADT/PointerIntPair.h b/include/llvm/ADT/PointerIntPair.h index 73ba3c7293..64f4a7cee4 100644 --- a/include/llvm/ADT/PointerIntPair.h +++ b/include/llvm/ADT/PointerIntPair.h @@ -106,6 +106,12 @@ public: bool operator>=(const PointerIntPair &RHS) const {return Value >= RHS.Value;} }; +template <typename T> struct isPodLike; +template<typename PointerTy, unsigned IntBits, typename IntType> +struct isPodLike<PointerIntPair<PointerTy, IntBits, IntType> > { + static const bool value = true; +}; + // Provide specialization of DenseMapInfo for PointerIntPair. template<typename PointerTy, unsigned IntBits, typename IntType> struct DenseMapInfo<PointerIntPair<PointerTy, IntBits, IntType> > { @@ -125,7 +131,6 @@ struct DenseMapInfo<PointerIntPair<PointerTy, IntBits, IntType> > { return unsigned(IV) ^ unsigned(IV >> 9); } static bool isEqual(const Ty &LHS, const Ty &RHS) { return LHS == RHS; } - static bool isPod() { return true; } }; // Teach SmallPtrSet that PointerIntPair is "basically a pointer". |