diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h index 4bda50f5a5cc0..25b5262800a10 100644 --- a/llvm/include/llvm/ADT/DenseMap.h +++ b/llvm/include/llvm/ADT/DenseMap.h @@ -42,7 +42,7 @@ namespace detail { // We extend a pair to allow users to override the bucket type with their own // implementation without requiring two members. template -struct DenseMapPair : public std::pair { +struct DenseMapPair : std::pair { using std::pair::pair; KeyT &getFirst() { return std::pair::first; } diff --git a/llvm/include/llvm/ADT/DepthFirstIterator.h b/llvm/include/llvm/ADT/DepthFirstIterator.h index 4ced758343806..3c54f321bf2d5 100644 --- a/llvm/include/llvm/ADT/DepthFirstIterator.h +++ b/llvm/include/llvm/ADT/DepthFirstIterator.h @@ -66,8 +66,8 @@ class df_iterator_storage { // one more method, completed, which is invoked when all children of a // node have been processed. It is intended to distinguish of back and // cross edges in the spanning tree but is not used in the common case. -template -struct df_iterator_default_set : public SmallPtrSet { +template +struct df_iterator_default_set : SmallPtrSet { using BaseSet = SmallPtrSet; using iterator = typename BaseSet::iterator; @@ -235,8 +235,10 @@ iterator_range> depth_first(const T& G) { } // Provide global definitions of external depth first iterators... -template ::NodeRef>> -struct df_ext_iterator : public df_iterator { +template ::NodeRef>> +struct df_ext_iterator : df_iterator { df_ext_iterator(const df_iterator &V) : df_iterator(V) {} }; @@ -262,7 +264,7 @@ template ::NodeRef>, bool External = false> -struct idf_iterator : public df_iterator, SetTy, External> { +struct idf_iterator : df_iterator, SetTy, External> { idf_iterator(const df_iterator, SetTy, External> &V) : df_iterator, SetTy, External>(V) {} }; @@ -284,8 +286,10 @@ iterator_range> inverse_depth_first(const T& G) { } // Provide global definitions of external inverse depth first iterators... -template ::NodeRef>> -struct idf_ext_iterator : public idf_iterator { +template ::NodeRef>> +struct idf_ext_iterator : idf_iterator { idf_ext_iterator(const idf_iterator &V) : idf_iterator(V) {} idf_ext_iterator(const df_iterator, SetTy, true> &V) diff --git a/llvm/include/llvm/ADT/ImmutableSet.h b/llvm/include/llvm/ADT/ImmutableSet.h index 310539fbb0f99..8b2425e4e8fef 100644 --- a/llvm/include/llvm/ADT/ImmutableSet.h +++ b/llvm/include/llvm/ADT/ImmutableSet.h @@ -931,8 +931,7 @@ struct ImutProfileInfo { /// ImutContainerInfo - Generic definition of comparison operations for /// elements of immutable containers that defaults to using /// std::equal_to<> and std::less<> to perform comparison of elements. -template -struct ImutContainerInfo : public ImutProfileInfo { +template struct ImutContainerInfo : ImutProfileInfo { using value_type = typename ImutProfileInfo::value_type; using value_type_ref = typename ImutProfileInfo::value_type_ref; using key_type = value_type; @@ -957,8 +956,7 @@ struct ImutContainerInfo : public ImutProfileInfo { /// ImutContainerInfo - Specialization for pointer values to treat pointers /// as references to unique objects. Pointers are thus compared by /// their addresses. -template -struct ImutContainerInfo : public ImutProfileInfo { +template struct ImutContainerInfo : ImutProfileInfo { using value_type = typename ImutProfileInfo::value_type; using value_type_ref = typename ImutProfileInfo::value_type_ref; using key_type = value_type; diff --git a/llvm/include/llvm/ADT/PostOrderIterator.h b/llvm/include/llvm/ADT/PostOrderIterator.h index 1cbd3c170052c..d9aa452e25d18 100644 --- a/llvm/include/llvm/ADT/PostOrderIterator.h +++ b/llvm/include/llvm/ADT/PostOrderIterator.h @@ -200,7 +200,7 @@ template iterator_range> post_order(const T &G) { // Provide global definitions of external postorder iterators... template ::NodeRef>> -struct po_ext_iterator : public po_iterator { +struct po_ext_iterator : po_iterator { po_ext_iterator(const po_iterator &V) : po_iterator(V) {} }; @@ -223,7 +223,7 @@ iterator_range> post_order_ext(const T &G, SetType & // Provide global definitions of inverse post order iterators... template ::NodeRef>, bool External = false> -struct ipo_iterator : public po_iterator, SetType, External> { +struct ipo_iterator : po_iterator, SetType, External> { ipo_iterator(const po_iterator, SetType, External> &V) : po_iterator, SetType, External> (V) {} }; @@ -245,7 +245,7 @@ iterator_range> inverse_post_order(const T &G) { // Provide global definitions of external inverse postorder iterators... template ::NodeRef>> -struct ipo_ext_iterator : public ipo_iterator { +struct ipo_ext_iterator : ipo_iterator { ipo_ext_iterator(const ipo_iterator &V) : ipo_iterator(V) {} ipo_ext_iterator(const po_iterator, SetType, true> &V) : diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index 658f26249122a..a9841c6651b72 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -674,7 +674,7 @@ using zip_traits = iterator_facade_base< ReferenceTupleType *, ReferenceTupleType>; template -struct zip_common : public zip_traits { +struct zip_common : zip_traits { using Base = zip_traits; using IndexSequence = std::index_sequence_for; using value_type = typename Base::value_type; diff --git a/llvm/include/llvm/Support/Alignment.h b/llvm/include/llvm/Support/Alignment.h index a4ca54e26f18d..f9d7c76836657 100644 --- a/llvm/include/llvm/Support/Alignment.h +++ b/llvm/include/llvm/Support/Alignment.h @@ -103,7 +103,7 @@ inline Align assumeAligned(uint64_t Value) { /// This struct is a compact representation of a valid (power of two) or /// undefined (0) alignment. -struct MaybeAlign : public std::optional { +struct MaybeAlign : std::optional { private: using UP = std::optional; diff --git a/llvm/include/llvm/Support/Casting.h b/llvm/include/llvm/Support/Casting.h index 2a9a149327d83..6f6df2e9703ea 100644 --- a/llvm/include/llvm/Support/Casting.h +++ b/llvm/include/llvm/Support/Casting.h @@ -340,7 +340,7 @@ struct ValueFromPointerCast /// during the cast. It's also a good example of how to implement a move-only /// cast. template -struct UniquePtrCast : public CastIsPossible { +struct UniquePtrCast : CastIsPossible { using Self = detail::SelfType>; using CastResultType = std::unique_ptr< std::remove_reference_t::ret_type>>; @@ -473,7 +473,7 @@ struct ForwardToPointerCast { // take advantage of the cast traits whenever possible! template -struct CastInfo : public CastIsPossible { +struct CastInfo : CastIsPossible { using Self = CastInfo; using CastReturnType = typename cast_retty::ret_type; @@ -536,8 +536,7 @@ struct CastInfo> : public UniquePtrCast {}; /// the input is std::optional that the output can be std::optional. /// If that's not the case, specialize CastInfo for your use case. template -struct CastInfo> : public OptionalValueCast { -}; +struct CastInfo> : OptionalValueCast {}; /// isa - Return true if the parameter to the template is an instance of one /// of the template type arguments. Used like this: diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h index dd05c530cc06e..5a5f00e844705 100644 --- a/llvm/include/llvm/Support/CommandLine.h +++ b/llvm/include/llvm/Support/CommandLine.h @@ -549,7 +549,7 @@ template struct OptionValue; // The default value safely does nothing. Option value printing is only // best-effort. template -struct OptionValueBase : public GenericOptionValue { +struct OptionValueBase : GenericOptionValue { // Temporary storage for argument passing. using WrapperType = OptionValue; diff --git a/llvm/include/llvm/Support/DOTGraphTraits.h b/llvm/include/llvm/Support/DOTGraphTraits.h index bf30aa4df9fab..3b9fe00d3282f 100644 --- a/llvm/include/llvm/Support/DOTGraphTraits.h +++ b/llvm/include/llvm/Support/DOTGraphTraits.h @@ -162,8 +162,7 @@ struct DefaultDOTGraphTraits { /// graphs are converted to 'dot' graphs. When specializing, you may inherit /// from DefaultDOTGraphTraits if you don't need to override everything. /// -template -struct DOTGraphTraits : public DefaultDOTGraphTraits { +template struct DOTGraphTraits : DefaultDOTGraphTraits { using DefaultDOTGraphTraits::DefaultDOTGraphTraits; }; diff --git a/llvm/include/llvm/Support/LSP/Protocol.h b/llvm/include/llvm/Support/LSP/Protocol.h index 93b82f1e581f8..e38203a8b4a39 100644 --- a/llvm/include/llvm/Support/LSP/Protocol.h +++ b/llvm/include/llvm/Support/LSP/Protocol.h @@ -449,7 +449,7 @@ struct ReferenceContext { bool fromJSON(const llvm::json::Value &value, ReferenceContext &result, llvm::json::Path path); -struct ReferenceParams : public TextDocumentPositionParams { +struct ReferenceParams : TextDocumentPositionParams { ReferenceContext context; }; diff --git a/llvm/include/llvm/Support/MD5.h b/llvm/include/llvm/Support/MD5.h index ed29826bab0cb..4ba386753f397 100644 --- a/llvm/include/llvm/Support/MD5.h +++ b/llvm/include/llvm/Support/MD5.h @@ -41,7 +41,7 @@ template class ArrayRef; class MD5 { public: - struct MD5Result : public std::array { + struct MD5Result : std::array { LLVM_ABI SmallString<32> digest() const; uint64_t low() const { diff --git a/llvm/include/llvm/Support/Timer.h b/llvm/include/llvm/Support/Timer.h index 40709d49db011..a4ed712577582 100644 --- a/llvm/include/llvm/Support/Timer.h +++ b/llvm/include/llvm/Support/Timer.h @@ -167,7 +167,7 @@ class TimeRegion { /// you to declare a new timer, AND specify the region to time, all in one /// statement. All timers with the same name are merged. This is primarily /// used for debugging and for hunting performance problems. -struct NamedRegionTimer : public TimeRegion { +struct NamedRegionTimer : TimeRegion { LLVM_ABI explicit NamedRegionTimer(StringRef Name, StringRef Description, StringRef GroupName, StringRef GroupDescription,