diff options
Diffstat (limited to 'include/llvm/ADT/DenseMap.h')
-rw-r--r-- | include/llvm/ADT/DenseMap.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h index 1f50502fff92..a05cf8130d3c 100644 --- a/include/llvm/ADT/DenseMap.h +++ b/include/llvm/ADT/DenseMap.h @@ -1,9 +1,8 @@ //===- llvm/ADT/DenseMap.h - Dense probed hash table ------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -64,7 +63,7 @@ struct DenseMapPair : public std::pair<KeyT, ValueT> { template <typename AltPairT> DenseMapPair(AltPairT &&AltPair, typename std::enable_if<std::is_convertible< - AltPairT, std::pair<KeyT, ValueT>>::value>::type * = 0) + AltPairT, std::pair<KeyT, ValueT>>::value>::type * = nullptr) : std::pair<KeyT, ValueT>(std::forward<AltPairT>(AltPair)) {} KeyT &getFirst() { return std::pair<KeyT, ValueT>::first; } @@ -146,7 +145,8 @@ public: } const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey(); - if (isPodLike<KeyT>::value && isPodLike<ValueT>::value) { + if (is_trivially_copyable<KeyT>::value && + is_trivially_copyable<ValueT>::value) { // Use a simpler loop when these are trivial types. for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P) P->getFirst() = EmptyKey; @@ -422,7 +422,8 @@ protected: setNumEntries(other.getNumEntries()); setNumTombstones(other.getNumTombstones()); - if (isPodLike<KeyT>::value && isPodLike<ValueT>::value) + if (is_trivially_copyable<KeyT>::value && + is_trivially_copyable<ValueT>::value) memcpy(reinterpret_cast<void *>(getBuckets()), other.getBuckets(), getNumBuckets() * sizeof(BucketT)); else |