summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/SmallPtrSet.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/ADT/SmallPtrSet.h')
-rw-r--r--include/llvm/ADT/SmallPtrSet.h30
1 files changed, 14 insertions, 16 deletions
diff --git a/include/llvm/ADT/SmallPtrSet.h b/include/llvm/ADT/SmallPtrSet.h
index 196ab6338047c..b49d216e0b6e7 100644
--- a/include/llvm/ADT/SmallPtrSet.h
+++ b/include/llvm/ADT/SmallPtrSet.h
@@ -27,15 +27,13 @@
#include <iterator>
#include <utility>
-#if LLVM_ENABLE_ABI_BREAKING_CHECKS
namespace llvm {
+
+#if LLVM_ENABLE_ABI_BREAKING_CHECKS
template <class T = void> struct ReverseIterate { static bool value; };
template <class T> bool ReverseIterate<T>::value = false;
-}
#endif
-namespace llvm {
-
/// SmallPtrSetImplBase - This is the common code shared among all the
/// SmallPtrSet<>'s, which is almost everything. SmallPtrSet has two modes, one
/// for small and one for large sets.
@@ -92,7 +90,7 @@ protected:
}
public:
- typedef unsigned size_type;
+ using size_type = unsigned;
SmallPtrSetImplBase &operator=(const SmallPtrSetImplBase &) = delete;
@@ -273,14 +271,14 @@ protected:
/// SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet.
template<typename PtrTy>
class SmallPtrSetIterator : public SmallPtrSetIteratorImpl {
- typedef PointerLikeTypeTraits<PtrTy> PtrTraits;
+ using PtrTraits = PointerLikeTypeTraits<PtrTy>;
public:
- typedef PtrTy value_type;
- typedef PtrTy reference;
- typedef PtrTy pointer;
- typedef std::ptrdiff_t difference_type;
- typedef std::forward_iterator_tag iterator_category;
+ using value_type = PtrTy;
+ using reference = PtrTy;
+ using pointer = PtrTy;
+ using difference_type = std::ptrdiff_t;
+ using iterator_category = std::forward_iterator_tag;
explicit SmallPtrSetIterator(const void *const *BP, const void *const *E)
: SmallPtrSetIteratorImpl(BP, E) {}
@@ -351,8 +349,8 @@ struct RoundUpToPowerOfTwo {
template <typename PtrType>
class SmallPtrSetImpl : public SmallPtrSetImplBase {
using ConstPtrType = typename add_const_past_pointer<PtrType>::type;
- typedef PointerLikeTypeTraits<PtrType> PtrTraits;
- typedef PointerLikeTypeTraits<ConstPtrType> ConstPtrTraits;
+ using PtrTraits = PointerLikeTypeTraits<PtrType>;
+ using ConstPtrTraits = PointerLikeTypeTraits<ConstPtrType>;
protected:
// Constructors that forward to the base.
@@ -365,8 +363,8 @@ protected:
: SmallPtrSetImplBase(SmallStorage, SmallSize) {}
public:
- typedef SmallPtrSetIterator<PtrType> iterator;
- typedef SmallPtrSetIterator<PtrType> const_iterator;
+ using iterator = SmallPtrSetIterator<PtrType>;
+ using const_iterator = SmallPtrSetIterator<PtrType>;
SmallPtrSetImpl(const SmallPtrSetImpl &) = delete;
@@ -431,7 +429,7 @@ class SmallPtrSet : public SmallPtrSetImpl<PtrType> {
// DenseSet<> instead if you expect many elements in the set.
static_assert(SmallSize <= 32, "SmallSize should be small");
- typedef SmallPtrSetImpl<PtrType> BaseT;
+ using BaseT = SmallPtrSetImpl<PtrType>;
// Make sure that SmallSize is a power of two, round up if not.
enum { SmallSizePowTwo = RoundUpToPowerOfTwo<SmallSize>::Val };