Skip to content

Commit f3baba6

Browse files
kazutakahirataDebadri Basak
authored andcommitted
[ADT, Support] Remove redundant typename (NFC) (llvm#166045)
Identified with readability-redundant-typename.
1 parent 319c2fb commit f3baba6

File tree

8 files changed

+21
-22
lines changed

8 files changed

+21
-22
lines changed

llvm/include/llvm/Support/CommandLine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2099,7 +2099,7 @@ getRegisteredOptions(SubCommand &Sub = SubCommand::getTopLevel());
20992099
///
21002100
/// This interface is useful for defining subcommands in libraries and
21012101
/// the dispatch from a single point (like in the main function).
2102-
LLVM_ABI iterator_range<typename SmallPtrSet<SubCommand *, 4>::iterator>
2102+
LLVM_ABI iterator_range<SmallPtrSet<SubCommand *, 4>::iterator>
21032103
getRegisteredSubcommands();
21042104

21052105
//===----------------------------------------------------------------------===//

llvm/include/llvm/Support/JSON.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -549,10 +549,10 @@ inline const Value &Array::back() const { return V.back(); }
549549
inline Value *Array::data() { return V.data(); }
550550
inline const Value *Array::data() const { return V.data(); }
551551

552-
inline typename Array::iterator Array::begin() { return V.begin(); }
553-
inline typename Array::const_iterator Array::begin() const { return V.begin(); }
554-
inline typename Array::iterator Array::end() { return V.end(); }
555-
inline typename Array::const_iterator Array::end() const { return V.end(); }
552+
inline Array::iterator Array::begin() { return V.begin(); }
553+
inline Array::const_iterator Array::begin() const { return V.begin(); }
554+
inline Array::iterator Array::end() { return V.end(); }
555+
inline Array::const_iterator Array::end() const { return V.end(); }
556556

557557
inline bool Array::empty() const { return V.empty(); }
558558
inline size_t Array::size() const { return V.size(); }
@@ -565,18 +565,18 @@ template <typename... Args> inline void Array::emplace_back(Args &&...A) {
565565
V.emplace_back(std::forward<Args>(A)...);
566566
}
567567
inline void Array::pop_back() { V.pop_back(); }
568-
inline typename Array::iterator Array::insert(const_iterator P, const Value &E) {
568+
inline Array::iterator Array::insert(const_iterator P, const Value &E) {
569569
return V.insert(P, E);
570570
}
571-
inline typename Array::iterator Array::insert(const_iterator P, Value &&E) {
571+
inline Array::iterator Array::insert(const_iterator P, Value &&E) {
572572
return V.insert(P, std::move(E));
573573
}
574574
template <typename It>
575-
inline typename Array::iterator Array::insert(const_iterator P, It A, It Z) {
575+
inline Array::iterator Array::insert(const_iterator P, It A, It Z) {
576576
return V.insert(P, A, Z);
577577
}
578578
template <typename... Args>
579-
inline typename Array::iterator Array::emplace(const_iterator P, Args &&...A) {
579+
inline Array::iterator Array::emplace(const_iterator P, Args &&...A) {
580580
return V.emplace(P, std::forward<Args>(A)...);
581581
}
582582
inline bool operator==(const Array &L, const Array &R) { return L.V == R.V; }

llvm/lib/Support/CommandLine.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ class CommandLineParser {
382382
RegisteredSubCommands.erase(sub);
383383
}
384384

385-
iterator_range<typename SmallPtrSet<SubCommand *, 4>::iterator>
385+
iterator_range<SmallPtrSet<SubCommand *, 4>::iterator>
386386
getRegisteredSubcommands() {
387387
return make_range(RegisteredSubCommands.begin(),
388388
RegisteredSubCommands.end());
@@ -2830,7 +2830,7 @@ StringMap<Option *> &cl::getRegisteredOptions(SubCommand &Sub) {
28302830
return Sub.OptionsMap;
28312831
}
28322832

2833-
iterator_range<typename SmallPtrSet<SubCommand *, 4>::iterator>
2833+
iterator_range<SmallPtrSet<SubCommand *, 4>::iterator>
28342834
cl::getRegisteredSubcommands() {
28352835
return GlobalParser->getRegisteredSubcommands();
28362836
}

llvm/unittests/ADT/BreadthFirstIteratorTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ TEST(BreadthFristIteratorTest, Cycle) {
7878

7979
static_assert(
8080
std::is_convertible_v<decltype(*std::declval<bf_iterator<Graph<3>>>()),
81-
typename bf_iterator<Graph<3>>::reference>);
81+
bf_iterator<Graph<3>>::reference>);
8282

8383
// bf_iterator should be (at-least) a forward-iterator
8484
static_assert(std::is_base_of_v<std::forward_iterator_tag,

llvm/unittests/ADT/DepthFirstIteratorTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ TEST(DepthFirstIteratorTest, ActuallyUpdateIterator) {
5959

6060
static_assert(
6161
std::is_convertible_v<decltype(*std::declval<df_iterator<Graph<3>>>()),
62-
typename df_iterator<Graph<3>>::reference>);
62+
df_iterator<Graph<3>>::reference>);
6363

6464
// df_iterator should be (at-least) a forward-iterator
6565
static_assert(std::is_base_of_v<std::forward_iterator_tag,

llvm/unittests/ADT/IListIteratorBitsTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,16 @@ TEST(IListIteratorBitsTest, ConsAndAssignment) {
9393
class dummy {
9494
// Test that we get an ilist_iterator_w_bits out of the node given that the
9595
// options are enabled.
96-
using node_options = typename ilist_detail::compute_node_options<
97-
Node, ilist_iterator_bits<true>>::type;
96+
using node_options =
97+
ilist_detail::compute_node_options<Node, ilist_iterator_bits<true>>::type;
9898
static_assert(std::is_same<Node::self_iterator,
9999
llvm::ilist_iterator_w_bits<node_options, false,
100100
false>>::value);
101101

102102
// Now test that a plain node, without the option, gets a plain
103103
// ilist_iterator.
104104
using plain_node_options =
105-
typename ilist_detail::compute_node_options<PlainNode>::type;
105+
ilist_detail::compute_node_options<PlainNode>::type;
106106
static_assert(std::is_same<
107107
PlainNode::self_iterator,
108108
llvm::ilist_iterator<plain_node_options, false, false>>::value);

llvm/unittests/ADT/IteratorTest.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@ struct AdaptedIter : iterator_adaptor_base<AdaptedIter, WeirdIter> {};
4848

4949
// Test that iterator_adaptor_base forwards typedefs, if value_type is
5050
// unchanged.
51-
static_assert(std::is_same_v<typename AdaptedIter::value_type, Shadow<0>>, "");
52-
static_assert(std::is_same_v<typename AdaptedIter::difference_type, Shadow<1>>,
53-
"");
54-
static_assert(std::is_same_v<typename AdaptedIter::pointer, Shadow<2>>, "");
55-
static_assert(std::is_same_v<typename AdaptedIter::reference, Shadow<3>>, "");
51+
static_assert(std::is_same_v<AdaptedIter::value_type, Shadow<0>>, "");
52+
static_assert(std::is_same_v<AdaptedIter::difference_type, Shadow<1>>, "");
53+
static_assert(std::is_same_v<AdaptedIter::pointer, Shadow<2>>, "");
54+
static_assert(std::is_same_v<AdaptedIter::reference, Shadow<3>>, "");
5655

5756
// Ensure that pointe{e,r}_iterator adaptors correctly forward the category of
5857
// the underlying iterator.

llvm/unittests/ADT/PostOrderIteratorTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ TEST(PostOrderIteratorTest, Compiles) {
4444

4545
static_assert(
4646
std::is_convertible_v<decltype(*std::declval<po_iterator<Graph<3>>>()),
47-
typename po_iterator<Graph<3>>::reference>);
47+
po_iterator<Graph<3>>::reference>);
4848

4949
// Test post-order and reverse post-order traversals for simple graph type.
5050
TEST(PostOrderIteratorTest, PostOrderAndReversePostOrderTraverrsal) {

0 commit comments

Comments
 (0)