summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/DenseMap.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/DenseMap.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/DenseMap.h')
-rw-r--r--include/llvm/ADT/DenseMap.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h
index 83299478e9..8b62f2d8c8 100644
--- a/include/llvm/ADT/DenseMap.h
+++ b/include/llvm/ADT/DenseMap.h
@@ -217,7 +217,8 @@ public:
private:
void CopyFrom(const DenseMap& other) {
- if (NumBuckets != 0 && (!KeyInfoT::isPod() || !ValueInfoT::isPod())) {
+ if (NumBuckets != 0 &&
+ (!isPodLike<KeyInfoT>::value || !isPodLike<ValueInfoT>::value)) {
const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) {
if (!KeyInfoT::isEqual(P->first, EmptyKey) &&
@@ -239,7 +240,7 @@ private:
Buckets = static_cast<BucketT*>(operator new(sizeof(BucketT) *
other.NumBuckets));
- if (KeyInfoT::isPod() && ValueInfoT::isPod())
+ if (isPodLike<KeyInfoT>::value && isPodLike<ValueInfoT>::value)
memcpy(Buckets, other.Buckets, other.NumBuckets * sizeof(BucketT));
else
for (size_t i = 0; i < other.NumBuckets; ++i) {