Skip to content

Commit 34ed1dc

Browse files
[ADT, Support] Drop "public" from public inheritance (NFC) (#164119)
1 parent 61e21f4 commit 34ed1dc

File tree

12 files changed

+27
-27
lines changed

12 files changed

+27
-27
lines changed

llvm/include/llvm/ADT/DenseMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace detail {
4242
// We extend a pair to allow users to override the bucket type with their own
4343
// implementation without requiring two members.
4444
template <typename KeyT, typename ValueT>
45-
struct DenseMapPair : public std::pair<KeyT, ValueT> {
45+
struct DenseMapPair : std::pair<KeyT, ValueT> {
4646
using std::pair<KeyT, ValueT>::pair;
4747

4848
KeyT &getFirst() { return std::pair<KeyT, ValueT>::first; }

llvm/include/llvm/ADT/DepthFirstIterator.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ class df_iterator_storage<SetType, true> {
6666
// one more method, completed, which is invoked when all children of a
6767
// node have been processed. It is intended to distinguish of back and
6868
// cross edges in the spanning tree but is not used in the common case.
69-
template <typename NodeRef, unsigned SmallSize=8>
70-
struct df_iterator_default_set : public SmallPtrSet<NodeRef, SmallSize> {
69+
template <typename NodeRef, unsigned SmallSize = 8>
70+
struct df_iterator_default_set : SmallPtrSet<NodeRef, SmallSize> {
7171
using BaseSet = SmallPtrSet<NodeRef, SmallSize>;
7272
using iterator = typename BaseSet::iterator;
7373

@@ -235,8 +235,10 @@ iterator_range<df_iterator<T>> depth_first(const T& G) {
235235
}
236236

237237
// Provide global definitions of external depth first iterators...
238-
template <class T, class SetTy = df_iterator_default_set<typename GraphTraits<T>::NodeRef>>
239-
struct df_ext_iterator : public df_iterator<T, SetTy, true> {
238+
template <class T,
239+
class SetTy =
240+
df_iterator_default_set<typename GraphTraits<T>::NodeRef>>
241+
struct df_ext_iterator : df_iterator<T, SetTy, true> {
240242
df_ext_iterator(const df_iterator<T, SetTy, true> &V)
241243
: df_iterator<T, SetTy, true>(V) {}
242244
};
@@ -262,7 +264,7 @@ template <class T,
262264
class SetTy =
263265
df_iterator_default_set<typename GraphTraits<T>::NodeRef>,
264266
bool External = false>
265-
struct idf_iterator : public df_iterator<Inverse<T>, SetTy, External> {
267+
struct idf_iterator : df_iterator<Inverse<T>, SetTy, External> {
266268
idf_iterator(const df_iterator<Inverse<T>, SetTy, External> &V)
267269
: df_iterator<Inverse<T>, SetTy, External>(V) {}
268270
};
@@ -284,8 +286,10 @@ iterator_range<idf_iterator<T>> inverse_depth_first(const T& G) {
284286
}
285287

286288
// Provide global definitions of external inverse depth first iterators...
287-
template <class T, class SetTy = df_iterator_default_set<typename GraphTraits<T>::NodeRef>>
288-
struct idf_ext_iterator : public idf_iterator<T, SetTy, true> {
289+
template <class T,
290+
class SetTy =
291+
df_iterator_default_set<typename GraphTraits<T>::NodeRef>>
292+
struct idf_ext_iterator : idf_iterator<T, SetTy, true> {
289293
idf_ext_iterator(const idf_iterator<T, SetTy, true> &V)
290294
: idf_iterator<T, SetTy, true>(V) {}
291295
idf_ext_iterator(const df_iterator<Inverse<T>, SetTy, true> &V)

llvm/include/llvm/ADT/ImmutableSet.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -931,8 +931,7 @@ struct ImutProfileInfo<T*> {
931931
/// ImutContainerInfo - Generic definition of comparison operations for
932932
/// elements of immutable containers that defaults to using
933933
/// std::equal_to<> and std::less<> to perform comparison of elements.
934-
template <typename T>
935-
struct ImutContainerInfo : public ImutProfileInfo<T> {
934+
template <typename T> struct ImutContainerInfo : ImutProfileInfo<T> {
936935
using value_type = typename ImutProfileInfo<T>::value_type;
937936
using value_type_ref = typename ImutProfileInfo<T>::value_type_ref;
938937
using key_type = value_type;
@@ -957,8 +956,7 @@ struct ImutContainerInfo : public ImutProfileInfo<T> {
957956
/// ImutContainerInfo - Specialization for pointer values to treat pointers
958957
/// as references to unique objects. Pointers are thus compared by
959958
/// their addresses.
960-
template <typename T>
961-
struct ImutContainerInfo<T*> : public ImutProfileInfo<T*> {
959+
template <typename T> struct ImutContainerInfo<T *> : ImutProfileInfo<T *> {
962960
using value_type = typename ImutProfileInfo<T*>::value_type;
963961
using value_type_ref = typename ImutProfileInfo<T*>::value_type_ref;
964962
using key_type = value_type;

llvm/include/llvm/ADT/PostOrderIterator.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ template <class T> iterator_range<po_iterator<T>> post_order(const T &G) {
200200

201201
// Provide global definitions of external postorder iterators...
202202
template <class T, class SetType = std::set<typename GraphTraits<T>::NodeRef>>
203-
struct po_ext_iterator : public po_iterator<T, SetType, true> {
203+
struct po_ext_iterator : po_iterator<T, SetType, true> {
204204
po_ext_iterator(const po_iterator<T, SetType, true> &V) :
205205
po_iterator<T, SetType, true>(V) {}
206206
};
@@ -223,7 +223,7 @@ iterator_range<po_ext_iterator<T, SetType>> post_order_ext(const T &G, SetType &
223223
// Provide global definitions of inverse post order iterators...
224224
template <class T, class SetType = std::set<typename GraphTraits<T>::NodeRef>,
225225
bool External = false>
226-
struct ipo_iterator : public po_iterator<Inverse<T>, SetType, External> {
226+
struct ipo_iterator : po_iterator<Inverse<T>, SetType, External> {
227227
ipo_iterator(const po_iterator<Inverse<T>, SetType, External> &V) :
228228
po_iterator<Inverse<T>, SetType, External> (V) {}
229229
};
@@ -245,7 +245,7 @@ iterator_range<ipo_iterator<T>> inverse_post_order(const T &G) {
245245

246246
// Provide global definitions of external inverse postorder iterators...
247247
template <class T, class SetType = std::set<typename GraphTraits<T>::NodeRef>>
248-
struct ipo_ext_iterator : public ipo_iterator<T, SetType, true> {
248+
struct ipo_ext_iterator : ipo_iterator<T, SetType, true> {
249249
ipo_ext_iterator(const ipo_iterator<T, SetType, true> &V) :
250250
ipo_iterator<T, SetType, true>(V) {}
251251
ipo_ext_iterator(const po_iterator<Inverse<T>, SetType, true> &V) :

llvm/include/llvm/ADT/STLExtras.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ using zip_traits = iterator_facade_base<
674674
ReferenceTupleType *, ReferenceTupleType>;
675675

676676
template <typename ZipType, typename ReferenceTupleType, typename... Iters>
677-
struct zip_common : public zip_traits<ZipType, ReferenceTupleType, Iters...> {
677+
struct zip_common : zip_traits<ZipType, ReferenceTupleType, Iters...> {
678678
using Base = zip_traits<ZipType, ReferenceTupleType, Iters...>;
679679
using IndexSequence = std::index_sequence_for<Iters...>;
680680
using value_type = typename Base::value_type;

llvm/include/llvm/Support/Alignment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ inline Align assumeAligned(uint64_t Value) {
103103

104104
/// This struct is a compact representation of a valid (power of two) or
105105
/// undefined (0) alignment.
106-
struct MaybeAlign : public std::optional<Align> {
106+
struct MaybeAlign : std::optional<Align> {
107107
private:
108108
using UP = std::optional<Align>;
109109

llvm/include/llvm/Support/Casting.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ struct ValueFromPointerCast
340340
/// during the cast. It's also a good example of how to implement a move-only
341341
/// cast.
342342
template <typename To, typename From, typename Derived = void>
343-
struct UniquePtrCast : public CastIsPossible<To, From *> {
343+
struct UniquePtrCast : CastIsPossible<To, From *> {
344344
using Self = detail::SelfType<Derived, UniquePtrCast<To, From>>;
345345
using CastResultType = std::unique_ptr<
346346
std::remove_reference_t<typename cast_retty<To, From>::ret_type>>;
@@ -473,7 +473,7 @@ struct ForwardToPointerCast {
473473
// take advantage of the cast traits whenever possible!
474474

475475
template <typename To, typename From, typename Enable = void>
476-
struct CastInfo : public CastIsPossible<To, From> {
476+
struct CastInfo : CastIsPossible<To, From> {
477477
using Self = CastInfo<To, From, Enable>;
478478

479479
using CastReturnType = typename cast_retty<To, From>::ret_type;
@@ -536,8 +536,7 @@ struct CastInfo<To, std::unique_ptr<From>> : public UniquePtrCast<To, From> {};
536536
/// the input is std::optional<From> that the output can be std::optional<To>.
537537
/// If that's not the case, specialize CastInfo for your use case.
538538
template <typename To, typename From>
539-
struct CastInfo<To, std::optional<From>> : public OptionalValueCast<To, From> {
540-
};
539+
struct CastInfo<To, std::optional<From>> : OptionalValueCast<To, From> {};
541540

542541
/// isa<X> - Return true if the parameter to the template is an instance of one
543542
/// of the template type arguments. Used like this:

llvm/include/llvm/Support/CommandLine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ template <class DataType> struct OptionValue;
549549
// The default value safely does nothing. Option value printing is only
550550
// best-effort.
551551
template <class DataType, bool isClass>
552-
struct OptionValueBase : public GenericOptionValue {
552+
struct OptionValueBase : GenericOptionValue {
553553
// Temporary storage for argument passing.
554554
using WrapperType = OptionValue<DataType>;
555555

llvm/include/llvm/Support/DOTGraphTraits.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ struct DefaultDOTGraphTraits {
162162
/// graphs are converted to 'dot' graphs. When specializing, you may inherit
163163
/// from DefaultDOTGraphTraits if you don't need to override everything.
164164
///
165-
template <typename Ty>
166-
struct DOTGraphTraits : public DefaultDOTGraphTraits {
165+
template <typename Ty> struct DOTGraphTraits : DefaultDOTGraphTraits {
167166
using DefaultDOTGraphTraits::DefaultDOTGraphTraits;
168167
};
169168

llvm/include/llvm/Support/LSP/Protocol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ struct ReferenceContext {
449449
bool fromJSON(const llvm::json::Value &value, ReferenceContext &result,
450450
llvm::json::Path path);
451451

452-
struct ReferenceParams : public TextDocumentPositionParams {
452+
struct ReferenceParams : TextDocumentPositionParams {
453453
ReferenceContext context;
454454
};
455455

0 commit comments

Comments
 (0)