[llvm] 17a3fbf - Remove code only needed to detect a pre-4.0 API break.

Owen Anderson via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 22:42:11 PDT 2023


Author: Owen Anderson
Date: 2023-04-24T22:42:05-07:00
New Revision: 17a3fbf2a3683f862de52e0058110eb8b356be56

URL: https://github.com/llvm/llvm-project/commit/17a3fbf2a3683f862de52e0058110eb8b356be56
DIFF: https://github.com/llvm/llvm-project/commit/17a3fbf2a3683f862de52e0058110eb8b356be56.diff

LOG: Remove code only needed to detect a pre-4.0 API break.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D149122

Added: 
    

Modified: 
    llvm/include/llvm/ADT/ilist.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/ilist.h b/llvm/include/llvm/ADT/ilist.h
index 9913b7cccbdda..aed19ccbff7f2 100644
--- a/llvm/include/llvm/ADT/ilist.h
+++ b/llvm/include/llvm/ADT/ilist.h
@@ -92,63 +92,6 @@ struct ilist_traits : public ilist_node_traits<NodeTy> {};
 /// Const traits should never be instantiated.
 template <typename Ty> struct ilist_traits<const Ty> {};
 
-namespace ilist_detail {
-
-template <class T> T &make();
-
-/// Type trait to check for a traits class that has a getNext member (as a
-/// canary for any of the ilist_nextprev_traits API).
-template <class TraitsT, class NodeT> struct HasGetNext {
-  typedef char Yes[1];
-  typedef char No[2];
-  template <size_t N> struct SFINAE {};
-
-  template <class U>
-  static Yes &test(U *I, decltype(I->getNext(&make<NodeT>())) * = nullptr);
-  template <class> static No &test(...);
-
-public:
-  static const bool value = sizeof(test<TraitsT>(nullptr)) == sizeof(Yes);
-};
-
-/// Type trait to check for a traits class that has a createSentinel member (as
-/// a canary for any of the ilist_sentinel_traits API).
-template <class TraitsT> struct HasCreateSentinel {
-  typedef char Yes[1];
-  typedef char No[2];
-
-  template <class U>
-  static Yes &test(U *I, decltype(I->createSentinel()) * = nullptr);
-  template <class> static No &test(...);
-
-public:
-  static const bool value = sizeof(test<TraitsT>(nullptr)) == sizeof(Yes);
-};
-
-/// Type trait to check for a traits class that has a createNode member.
-/// Allocation should be managed in a wrapper class, instead of in
-/// ilist_traits.
-template <class TraitsT, class NodeT> struct HasCreateNode {
-  typedef char Yes[1];
-  typedef char No[2];
-  template <size_t N> struct SFINAE {};
-
-  template <class U>
-  static Yes &test(U *I, decltype(I->createNode(make<NodeT>())) * = 0);
-  template <class> static No &test(...);
-
-public:
-  static const bool value = sizeof(test<TraitsT>(nullptr)) == sizeof(Yes);
-};
-
-template <class TraitsT, class NodeT> struct HasObsoleteCustomization {
-  static const bool value = HasGetNext<TraitsT, NodeT>::value ||
-                            HasCreateSentinel<TraitsT>::value ||
-                            HasCreateNode<TraitsT, NodeT>::value;
-};
-
-} // end namespace ilist_detail
-
 //===----------------------------------------------------------------------===//
 //
 /// A wrapper around an intrusive list with callbacks and non-intrusive
@@ -182,13 +125,6 @@ class iplist_impl : public TraitsT, IntrusiveListT {
       typename base_list_type::const_reverse_iterator const_reverse_iterator;
 
 private:
-  // TODO: Drop this assertion and the transitive type traits anytime after
-  // v4.0 is branched (i.e,. keep them for one release to help out-of-tree code
-  // update).
-  static_assert(
-      !ilist_detail::HasObsoleteCustomization<TraitsT, value_type>::value,
-      "ilist customization points have changed!");
-
   static bool op_less(const_reference L, const_reference R) { return L < R; }
   static bool op_equal(const_reference L, const_reference R) { return L == R; }
 


        


More information about the llvm-commits mailing list