Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions llvm/include/llvm/ADT/APFloat.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class APFloatBase {
static constexpr unsigned integerPartWidth = APInt::APINT_BITS_PER_WORD;

/// A signed type to represent a floating point numbers unbiased exponent.
typedef int32_t ExponentType;
using ExponentType = int32_t;

/// \name Floating Point Semantics.
/// @{
Expand Down Expand Up @@ -938,8 +938,8 @@ LLVM_ABI DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, roundingMode);
// This is a interface class that is currently forwarding functionalities from
// detail::IEEEFloat.
class APFloat : public APFloatBase {
typedef detail::IEEEFloat IEEEFloat;
typedef detail::DoubleAPFloat DoubleAPFloat;
using IEEEFloat = detail::IEEEFloat;
using DoubleAPFloat = detail::DoubleAPFloat;

static_assert(std::is_standard_layout<IEEEFloat>::value);

Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/ADT/APInt.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ inline APInt operator-(APInt);
///
class [[nodiscard]] APInt {
public:
typedef uint64_t WordType;
using WordType = uint64_t;

/// Byte size of a word.
static constexpr unsigned APINT_WORD_SIZE = sizeof(WordType);
Expand Down
6 changes: 3 additions & 3 deletions llvm/include/llvm/ADT/BitVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ template <typename BitVectorT> class const_set_bits_iterator_impl {
};

class BitVector {
typedef uintptr_t BitWord;
using BitWord = uintptr_t;

enum { BITWORD_SIZE = (unsigned)sizeof(BitWord) * CHAR_BIT };

Expand Down Expand Up @@ -147,8 +147,8 @@ class BitVector {
}
};

typedef const_set_bits_iterator_impl<BitVector> const_set_bits_iterator;
typedef const_set_bits_iterator set_iterator;
using const_set_bits_iterator = const_set_bits_iterator_impl<BitVector>;
using set_iterator = const_set_bits_iterator;

const_set_bits_iterator set_bits_begin() const {
return const_set_bits_iterator(*this);
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/ADT/GenericSSAContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ template <typename, bool> class DominatorTreeBase;
template <typename> class SmallVectorImpl;

namespace Intrinsic {
typedef unsigned ID;
using ID = unsigned;
}

// Specializations of this template should provide the types used by the
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/ADT/STLExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -1516,8 +1516,8 @@ template <class Iterator, class RNG>
void shuffle(Iterator first, Iterator last, RNG &&g) {
// It would be better to use a std::uniform_int_distribution,
// but that would be stdlib dependent.
typedef
typename std::iterator_traits<Iterator>::difference_type difference_type;
using difference_type =
typename std::iterator_traits<Iterator>::difference_type;
for (auto size = last - first; size > 1; ++first, (void)--size) {
difference_type offset = g() % size;
// Avoid self-assignment due to incorrect assertions in libstdc++
Expand Down
26 changes: 13 additions & 13 deletions llvm/include/llvm/ADT/ilist.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,21 @@ template <typename Ty> struct ilist_traits<const Ty> {};
/// list.
template <class IntrusiveListT, class TraitsT>
class iplist_impl : public TraitsT, IntrusiveListT {
typedef IntrusiveListT base_list_type;
using base_list_type = IntrusiveListT;

public:
typedef typename base_list_type::pointer pointer;
typedef typename base_list_type::const_pointer const_pointer;
typedef typename base_list_type::reference reference;
typedef typename base_list_type::const_reference const_reference;
typedef typename base_list_type::value_type value_type;
typedef typename base_list_type::size_type size_type;
typedef typename base_list_type::difference_type difference_type;
typedef typename base_list_type::iterator iterator;
typedef typename base_list_type::const_iterator const_iterator;
typedef typename base_list_type::reverse_iterator reverse_iterator;
typedef
typename base_list_type::const_reverse_iterator const_reverse_iterator;
using pointer = typename base_list_type::pointer;
using const_pointer = typename base_list_type::const_pointer;
using reference = typename base_list_type::reference;
using const_reference = typename base_list_type::const_reference;
using value_type = typename base_list_type::value_type;
using size_type = typename base_list_type::size_type;
using difference_type = typename base_list_type::difference_type;
using iterator = typename base_list_type::iterator;
using const_iterator = typename base_list_type::const_iterator;
using reverse_iterator = typename base_list_type::reverse_iterator;
using const_reverse_iterator =
typename base_list_type::const_reverse_iterator;

private:
static bool op_less(const_reference L, const_reference R) { return L < R; }
Expand Down
43 changes: 22 additions & 21 deletions llvm/include/llvm/ADT/ilist_node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ namespace ilist_detail {
template <bool IsExplicit> struct explicitness {
static const bool is_explicit = IsExplicit;
};
typedef explicitness<true> is_explicit;
typedef explicitness<false> is_implicit;
using is_explicit = explicitness<true>;
using is_implicit = explicitness<false>;

/// Check whether an option is valid.
///
Expand Down Expand Up @@ -103,12 +103,12 @@ struct is_valid_option<ilist_sentinel_tracking<EnableSentinelTracking>>
template <class... Options> struct extract_tag;
template <class Tag, class... Options>
struct extract_tag<ilist_tag<Tag>, Options...> {
typedef Tag type;
using type = Tag;
};
template <class Option1, class... Options>
struct extract_tag<Option1, Options...> : extract_tag<Options...> {};
template <> struct extract_tag<> {
typedef void type;
using type = void;
};
template <class Tag> struct is_valid_option<ilist_tag<Tag>> : std::true_type {};

Expand All @@ -134,11 +134,13 @@ struct is_valid_option<ilist_iterator_bits<IteratorBits>> : std::true_type {};
template <class... Options> struct extract_parent;
template <class ParentTy, class... Options>
struct extract_parent<ilist_parent<ParentTy>, Options...> {
typedef ParentTy type;
using type = ParentTy;
};
template <class Option1, class... Options>
struct extract_parent<Option1, Options...> : extract_parent<Options...> {};
template <> struct extract_parent<> { typedef void type; };
template <> struct extract_parent<> {
using type = void;
};
template <class ParentTy>
struct is_valid_option<ilist_parent<ParentTy>> : std::true_type {};

Expand All @@ -154,28 +156,27 @@ struct check_options : std::conjunction<is_valid_option<Options>...> {};
template <class T, bool EnableSentinelTracking, bool IsSentinelTrackingExplicit,
class TagT, bool HasIteratorBits, class ParentTy>
struct node_options {
typedef T value_type;
typedef T *pointer;
typedef T &reference;
typedef const T *const_pointer;
typedef const T &const_reference;
using value_type = T;
using pointer = T *;
using reference = T &;
using const_pointer = const T *;
using const_reference = const T &;

static const bool enable_sentinel_tracking = EnableSentinelTracking;
static const bool is_sentinel_tracking_explicit = IsSentinelTrackingExplicit;
static const bool has_iterator_bits = HasIteratorBits;
typedef TagT tag;
typedef ParentTy parent_ty;
typedef ilist_node_base<enable_sentinel_tracking, parent_ty> node_base_type;
typedef ilist_base<enable_sentinel_tracking, parent_ty> list_base_type;
using tag = TagT;
using parent_ty = ParentTy;
using node_base_type = ilist_node_base<enable_sentinel_tracking, parent_ty>;
using list_base_type = ilist_base<enable_sentinel_tracking, parent_ty>;
};

template <class T, class... Options> struct compute_node_options {
typedef node_options<T, extract_sentinel_tracking<Options...>::value,
extract_sentinel_tracking<Options...>::is_explicit,
typename extract_tag<Options...>::type,
extract_iterator_bits<Options...>::value,
typename extract_parent<Options...>::type>
type;
using type = node_options<T, extract_sentinel_tracking<Options...>::value,
extract_sentinel_tracking<Options...>::is_explicit,
typename extract_tag<Options...>::type,
extract_iterator_bits<Options...>::value,
typename extract_parent<Options...>::type>;
};

} // end namespace ilist_detail
Expand Down
2 changes: 1 addition & 1 deletion llvm/unittests/ADT/APFloatTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10118,7 +10118,7 @@ TEST(APFloatTest, Float4E2M1FNToFloat) {
}

TEST(APFloatTest, AddOrSubtractSignificand) {
typedef detail::IEEEFloatUnitTestHelper Helper;
using Helper = detail::IEEEFloatUnitTestHelper;
// Test cases are all combinations of:
// {equal exponents, LHS larger exponent, RHS larger exponent}
// {equal significands, LHS larger significand, RHS larger significand}
Expand Down
4 changes: 2 additions & 2 deletions llvm/unittests/ADT/BitVectorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ template <typename T>
class BitVectorTest : public ::testing::Test { };

// Test both BitVector and SmallBitVector with the same suite of tests.
typedef ::testing::Types<BitVector, SmallBitVector> BitVectorTestTypes;
using BitVectorTestTypes = ::testing::Types<BitVector, SmallBitVector>;
TYPED_TEST_SUITE(BitVectorTest, BitVectorTestTypes, );

TYPED_TEST(BitVectorTest, TrivialOperation) {
Expand Down Expand Up @@ -857,7 +857,7 @@ TYPED_TEST(BitVectorTest, BinOps) {
EXPECT_FALSE(B.anyCommon(A));
}

typedef std::vector<std::pair<int, int>> RangeList;
using RangeList = std::vector<std::pair<int, int>>;

template <typename VecType>
static inline VecType createBitVector(uint32_t Size,
Expand Down
4 changes: 2 additions & 2 deletions llvm/unittests/ADT/BreadthFirstIteratorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using namespace llvm;
namespace llvm {

TEST(BreadthFristIteratorTest, Basic) {
typedef bf_iterator<Graph<4>> BFIter;
using BFIter = bf_iterator<Graph<4>>;

Graph<4> G;
G.AddEdge(0, 1);
Expand All @@ -46,7 +46,7 @@ TEST(BreadthFristIteratorTest, Basic) {
}

TEST(BreadthFristIteratorTest, Cycle) {
typedef bf_iterator<Graph<4>> BFIter;
using BFIter = bf_iterator<Graph<4>>;

Graph<4> G;
G.AddEdge(0, 1);
Expand Down
2 changes: 1 addition & 1 deletion llvm/unittests/ADT/DAGDeltaAlgorithmTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using namespace llvm;

namespace {

typedef DAGDeltaAlgorithm::edge_ty edge_ty;
using edge_ty = DAGDeltaAlgorithm::edge_ty;

class FixedDAGDeltaAlgorithm : public DAGDeltaAlgorithm {
changeset_ty FailingSet;
Expand Down
23 changes: 11 additions & 12 deletions llvm/unittests/ADT/DenseMapTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,17 @@ typename T::mapped_type *const DenseMapTest<T>::dummy_value_ptr = nullptr;

// Register these types for testing.
// clang-format off
typedef ::testing::Types<DenseMap<uint32_t, uint32_t>,
DenseMap<uint32_t *, uint32_t *>,
DenseMap<CtorTester, CtorTester, CtorTesterMapInfo>,
DenseMap<EnumClass, uint32_t>,
DenseMap<std::optional<uint32_t>, uint32_t>,
SmallDenseMap<uint32_t, uint32_t>,
SmallDenseMap<uint32_t *, uint32_t *>,
SmallDenseMap<CtorTester, CtorTester, 4,
CtorTesterMapInfo>,
SmallDenseMap<EnumClass, uint32_t>,
SmallDenseMap<std::optional<uint32_t>, uint32_t>
> DenseMapTestTypes;
using DenseMapTestTypes = ::testing::Types<
DenseMap<uint32_t, uint32_t>,
DenseMap<uint32_t *, uint32_t *>,
DenseMap<CtorTester, CtorTester, CtorTesterMapInfo>,
DenseMap<EnumClass, uint32_t>,
DenseMap<std::optional<uint32_t>, uint32_t>,
SmallDenseMap<uint32_t, uint32_t>,
SmallDenseMap<uint32_t *, uint32_t *>,
SmallDenseMap<CtorTester, CtorTester, 4, CtorTesterMapInfo>,
SmallDenseMap<EnumClass, uint32_t>,
SmallDenseMap<std::optional<uint32_t>, uint32_t>>;
// clang-format on

TYPED_TEST_SUITE(DenseMapTest, DenseMapTestTypes, );
Expand Down
14 changes: 7 additions & 7 deletions llvm/unittests/ADT/DenseSetTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ template <typename T> class DenseSetTest : public testing::Test {
};

// Register these types for testing.
typedef ::testing::Types<DenseSet<unsigned, TestDenseSetInfo>,
const DenseSet<unsigned, TestDenseSetInfo>,
SmallDenseSet<unsigned, 1, TestDenseSetInfo>,
SmallDenseSet<unsigned, 4, TestDenseSetInfo>,
const SmallDenseSet<unsigned, 4, TestDenseSetInfo>,
SmallDenseSet<unsigned, 64, TestDenseSetInfo>>
DenseSetTestTypes;
using DenseSetTestTypes =
::testing::Types<DenseSet<unsigned, TestDenseSetInfo>,
const DenseSet<unsigned, TestDenseSetInfo>,
SmallDenseSet<unsigned, 1, TestDenseSetInfo>,
SmallDenseSet<unsigned, 4, TestDenseSetInfo>,
const SmallDenseSet<unsigned, 4, TestDenseSetInfo>,
SmallDenseSet<unsigned, 64, TestDenseSetInfo>>;
TYPED_TEST_SUITE(DenseSetTest, DenseSetTestTypes, );

TYPED_TEST(DenseSetTest, Constructor) {
Expand Down
6 changes: 3 additions & 3 deletions llvm/unittests/ADT/DepthFirstIteratorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using namespace llvm;
namespace llvm {

template <typename T> struct CountedSet {
typedef typename SmallPtrSet<T, 4>::iterator iterator;
using iterator = typename SmallPtrSet<T, 4>::iterator;

SmallPtrSet<T, 4> S;
int InsertVisited = 0;
Expand All @@ -44,8 +44,8 @@ template <typename T> class df_iterator_storage<CountedSet<T>, true> {
};

TEST(DepthFirstIteratorTest, ActuallyUpdateIterator) {
typedef CountedSet<Graph<3>::NodeType *> StorageT;
typedef df_iterator<Graph<3>, StorageT, true> DFIter;
using StorageT = CountedSet<Graph<3>::NodeType *>;
using DFIter = df_iterator<Graph<3>, StorageT, true>;

Graph<3> G;
G.AddEdge(0, 1);
Expand Down
25 changes: 13 additions & 12 deletions llvm/unittests/ADT/IListBaseTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ template <typename T> class IListBaseTest : public ::testing::Test {};
class Parent;

// Test variants with the same test.
typedef ::testing::Types<ilist_base<false, void>, ilist_base<true, void>, ilist_base<false, Parent*>, ilist_base<true, Parent*>>
IListBaseTestTypes;
using IListBaseTestTypes =
::testing::Types<ilist_base<false, void>, ilist_base<true, void>,
ilist_base<false, Parent *>, ilist_base<true, Parent *>>;
TYPED_TEST_SUITE(IListBaseTest, IListBaseTestTypes, );

TYPED_TEST(IListBaseTest, insertBeforeImpl) {
typedef TypeParam list_base_type;
typedef typename list_base_type::node_base_type node_base_type;
using list_base_type = TypeParam;
using node_base_type = typename list_base_type::node_base_type;

node_base_type S, A, B;

Expand All @@ -51,8 +52,8 @@ TYPED_TEST(IListBaseTest, insertBeforeImpl) {
}

TYPED_TEST(IListBaseTest, removeImpl) {
typedef TypeParam list_base_type;
typedef typename list_base_type::node_base_type node_base_type;
using list_base_type = TypeParam;
using node_base_type = typename list_base_type::node_base_type;

node_base_type S, A, B;

Expand Down Expand Up @@ -80,8 +81,8 @@ TYPED_TEST(IListBaseTest, removeImpl) {
}

TYPED_TEST(IListBaseTest, removeRangeImpl) {
typedef TypeParam list_base_type;
typedef typename list_base_type::node_base_type node_base_type;
using list_base_type = TypeParam;
using node_base_type = typename list_base_type::node_base_type;

node_base_type S, A, B, C, D;

Expand All @@ -106,8 +107,8 @@ TYPED_TEST(IListBaseTest, removeRangeImpl) {
}

TYPED_TEST(IListBaseTest, removeRangeImplAllButSentinel) {
typedef TypeParam list_base_type;
typedef typename list_base_type::node_base_type node_base_type;
using list_base_type = TypeParam;
using node_base_type = typename list_base_type::node_base_type;

node_base_type S, A, B;

Expand All @@ -126,8 +127,8 @@ TYPED_TEST(IListBaseTest, removeRangeImplAllButSentinel) {
}

TYPED_TEST(IListBaseTest, transferBeforeImpl) {
typedef TypeParam list_base_type;
typedef typename list_base_type::node_base_type node_base_type;
using list_base_type = TypeParam;
using node_base_type = typename list_base_type::node_base_type;

node_base_type S1, S2, A, B, C, D, E;

Expand Down
8 changes: 4 additions & 4 deletions llvm/unittests/ADT/IListIteratorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ TEST(IListIteratorTest, ReverseConstructor) {
L.insert(L.end(), B);

// Save typing.
typedef simple_ilist<Node>::iterator iterator;
typedef simple_ilist<Node>::reverse_iterator reverse_iterator;
typedef simple_ilist<Node>::const_iterator const_iterator;
typedef simple_ilist<Node>::const_reverse_iterator const_reverse_iterator;
using iterator = simple_ilist<Node>::iterator;
using reverse_iterator = simple_ilist<Node>::reverse_iterator;
using const_iterator = simple_ilist<Node>::const_iterator;
using const_reverse_iterator = simple_ilist<Node>::const_reverse_iterator;

// Check conversion values.
EXPECT_EQ(L.begin(), iterator(L.rend()));
Expand Down
Loading