diff --git a/llvm/include/llvm/ADT/SparseBitVector.h b/llvm/include/llvm/ADT/SparseBitVector.h index 4e19b16f61a725143b6d6d223c11676d805270b6..5d21c076a47d84a37e33fc3691c6587b89df94de 100644 --- a/llvm/include/llvm/ADT/SparseBitVector.h +++ b/llvm/include/llvm/ADT/SparseBitVector.h @@ -55,8 +55,6 @@ private: // Index of Element in terms of where first bit starts. unsigned ElementIndex; BitWord Bits[BITWORDS_PER_ELEMENT]; - // Needed for sentinels - friend struct ilist_sentinel_traits; SparseBitVectorElement() { ElementIndex = ~0U; memset(&Bits[0], 0, sizeof (BitWord) * BITWORDS_PER_ELEMENT); @@ -244,11 +242,6 @@ public: } }; -template -struct ilist_sentinel_traits> - : public ilist_half_embedded_sentinel_traits< - SparseBitVectorElement> {}; - template class SparseBitVector { typedef ilist > ElementList; diff --git a/llvm/include/llvm/ADT/ilist.h b/llvm/include/llvm/ADT/ilist.h index e326f3f9220249c1a2d63281b751303e96d67d6e..04bb560825289b66d7310abfeef5d547b031b9da 100644 --- a/llvm/include/llvm/ADT/ilist.h +++ b/llvm/include/llvm/ADT/ilist.h @@ -119,12 +119,6 @@ template struct HasObsoleteCustomization { template struct ilist_traits; -// TODO: Delete uses from subprojects, then delete these. -template struct ilist_sentinel_traits {}; -template struct ilist_embedded_sentinel_traits {}; -template struct ilist_half_embedded_sentinel_traits {}; -template struct ilist_full_embedded_sentinel_traits {}; - /// ilist_node_traits - A fragment for template traits for intrusive list /// that provides default node related operations. /// diff --git a/llvm/include/llvm/ADT/ilist_node.h b/llvm/include/llvm/ADT/ilist_node.h index 3a217ca01506507e4da87f2d5fb34cf38002c1b0..756745bd6da8555a67756fae32a57d507824c9c2 100644 --- a/llvm/include/llvm/ADT/ilist_node.h +++ b/llvm/include/llvm/ADT/ilist_node.h @@ -21,8 +21,6 @@ namespace llvm { template struct ilist_traits; -template struct ilist_embedded_sentinel_traits; -template struct ilist_half_embedded_sentinel_traits; /// Base class for ilist nodes. struct ilist_node_base { @@ -55,8 +53,6 @@ template class ilist_sentinel; template class ilist_node : ilist_node_base { friend struct ilist_node_access; friend struct ilist_traits; - friend struct ilist_half_embedded_sentinel_traits; - friend struct ilist_embedded_sentinel_traits; friend class ilist_iterator; friend class ilist_sentinel; diff --git a/llvm/include/llvm/Analysis/AliasSetTracker.h b/llvm/include/llvm/Analysis/AliasSetTracker.h index 0021f2815f5acd7eab059a2f48ea55c8ab03ecfe..5ebef3c69ec04807357d16787fc534169bef0ad1 100644 --- a/llvm/include/llvm/Analysis/AliasSetTracker.h +++ b/llvm/include/llvm/Analysis/AliasSetTracker.h @@ -239,9 +239,7 @@ public: }; private: - // Can only be created by AliasSetTracker. Also, ilist creates one - // to serve as a sentinel. - friend struct ilist_sentinel_traits; + // Can only be created by AliasSetTracker. AliasSet() : PtrList(nullptr), PtrListEnd(&PtrList), Forward(nullptr), RefCount(0), AliasAny(false), Access(NoAccess), Alias(SetMustAlias), diff --git a/llvm/include/llvm/Analysis/IVUsers.h b/llvm/include/llvm/Analysis/IVUsers.h index 16161be8db0b539ee8050b4f34674f1cec8dc371..b208c027e45cfcce785ee3d5e4223dc001310f4f 100644 --- a/llvm/include/llvm/Analysis/IVUsers.h +++ b/llvm/include/llvm/Analysis/IVUsers.h @@ -91,10 +91,6 @@ private: void deleted() override; }; -template <> -struct ilist_sentinel_traits - : public ilist_embedded_sentinel_traits {}; - class IVUsers { friend class IVStrideUse; Loop *L; diff --git a/llvm/include/llvm/CodeGen/MachineBasicBlock.h b/llvm/include/llvm/CodeGen/MachineBasicBlock.h index 37a7948c9ef95d4ec0de61aff70b467ab45ef672..e789b2e322ae507db720661d64c54d98631ca54e 100644 --- a/llvm/include/llvm/CodeGen/MachineBasicBlock.h +++ b/llvm/include/llvm/CodeGen/MachineBasicBlock.h @@ -38,10 +38,6 @@ class MachineBranchProbabilityInfo; // Forward declaration to avoid circular include problem with TargetRegisterInfo typedef unsigned LaneBitmask; -template <> -struct ilist_sentinel_traits - : public ilist_half_embedded_sentinel_traits {}; - template <> struct ilist_traits : public ilist_default_traits { private: diff --git a/llvm/include/llvm/CodeGen/MachineFunction.h b/llvm/include/llvm/CodeGen/MachineFunction.h index 7374c07732bb8242bdea682ce114ee97a78b69f7..8ad04e05e2b6c73c5d2351cb629ba3cfc554167f 100644 --- a/llvm/include/llvm/CodeGen/MachineFunction.h +++ b/llvm/include/llvm/CodeGen/MachineFunction.h @@ -48,10 +48,6 @@ class TargetRegisterClass; struct MachinePointerInfo; struct WinEHFuncInfo; -template <> -struct ilist_sentinel_traits - : public ilist_half_embedded_sentinel_traits {}; - template <> struct ilist_traits : public ilist_default_traits { diff --git a/llvm/include/llvm/CodeGen/SelectionDAG.h b/llvm/include/llvm/CodeGen/SelectionDAG.h index e6d71a7be5cd55b19318559d48c8566849479f31..485426275b0fc9729430451f8eac1312ae00ab0f 100644 --- a/llvm/include/llvm/CodeGen/SelectionDAG.h +++ b/llvm/include/llvm/CodeGen/SelectionDAG.h @@ -81,10 +81,6 @@ template<> struct FoldingSetTrait : DefaultFoldingSetTrait -struct ilist_sentinel_traits - : public ilist_half_embedded_sentinel_traits {}; - template <> struct ilist_traits : public ilist_default_traits { static void deleteNode(SDNode *) { llvm_unreachable("ilist_traits shouldn't see a deleteNode call!"); diff --git a/llvm/include/llvm/CodeGen/SlotIndexes.h b/llvm/include/llvm/CodeGen/SlotIndexes.h index 6090ecec32a623a500d1f32679cdf0d519a66c18..57fb2df37dafcd0edfcf0b6de57032360eb0e202 100644 --- a/llvm/include/llvm/CodeGen/SlotIndexes.h +++ b/llvm/include/llvm/CodeGen/SlotIndexes.h @@ -68,10 +68,6 @@ namespace llvm { #endif // EXPENSIVE_CHECKS }; - template <> - struct ilist_sentinel_traits - : public ilist_half_embedded_sentinel_traits {}; - template <> struct ilist_traits : public ilist_default_traits { diff --git a/llvm/include/llvm/IR/BasicBlock.h b/llvm/include/llvm/IR/BasicBlock.h index e7daf6ee238e3010faeffd93c17ce1a44643fe09..50eedecc4af1c88ba8322d32ab547ab4f187bfcf 100644 --- a/llvm/include/llvm/IR/BasicBlock.h +++ b/llvm/include/llvm/IR/BasicBlock.h @@ -30,10 +30,6 @@ class LLVMContext; class BlockAddress; class Function; -template <> -struct SymbolTableListSentinelTraits - : public ilist_half_embedded_sentinel_traits {}; - /// \brief LLVM Basic Block Representation /// /// This represents a single basic block in LLVM. A basic block is simply a diff --git a/llvm/include/llvm/IR/Function.h b/llvm/include/llvm/IR/Function.h index bf82b988996d1cbf0680b1f11fd0070fa662e250..ff55fcbf7fede15b38da274d58e08f6f875d1548 100644 --- a/llvm/include/llvm/IR/Function.h +++ b/llvm/include/llvm/IR/Function.h @@ -34,10 +34,6 @@ class FunctionType; class LLVMContext; class DISubprogram; -template <> -struct SymbolTableListSentinelTraits - : public ilist_half_embedded_sentinel_traits {}; - class Function : public GlobalObject, public ilist_node { public: typedef SymbolTableList ArgumentListType; diff --git a/llvm/include/llvm/IR/Instruction.h b/llvm/include/llvm/IR/Instruction.h index bd2e0fe2c96e4039180aefb8e6004d174750f6f0..576f439977c5e1120ad5c08ac9dccad0c67228ac 100644 --- a/llvm/include/llvm/IR/Instruction.h +++ b/llvm/include/llvm/IR/Instruction.h @@ -29,10 +29,6 @@ class MDNode; class BasicBlock; struct AAMDNodes; -template <> -struct SymbolTableListSentinelTraits - : public ilist_half_embedded_sentinel_traits {}; - class Instruction : public User, public ilist_node_with_parent { void operator=(const Instruction &) = delete; diff --git a/llvm/include/llvm/IR/Module.h b/llvm/include/llvm/IR/Module.h index ef7e407417698b7367216b62497777045e02c7c5..d3b56ee3247dd002b698ca4b598cf182a8aef2d8 100644 --- a/llvm/include/llvm/IR/Module.h +++ b/llvm/include/llvm/IR/Module.h @@ -37,10 +37,6 @@ class RandomNumberGenerator; class StructType; template class SmallPtrSetImpl; -template <> -struct ilist_sentinel_traits - : public ilist_embedded_sentinel_traits {}; - template<> struct ilist_traits : public ilist_default_traits { void addNodeToList(NamedMDNode *) {} diff --git a/llvm/include/llvm/IR/SymbolTableListTraits.h b/llvm/include/llvm/IR/SymbolTableListTraits.h index 42320a96f3913855cce6d72eaf546b1e25ca2867..f0f8ba3ae4d4f815ffb1cc3359e1bae0bf8db5e9 100644 --- a/llvm/include/llvm/IR/SymbolTableListTraits.h +++ b/llvm/include/llvm/IR/SymbolTableListTraits.h @@ -34,10 +34,6 @@ template class ilist_iterator; template class iplist; template struct ilist_traits; -template -struct SymbolTableListSentinelTraits - : public ilist_embedded_sentinel_traits {}; - /// Template metafunction to get the parent type for a symbol table list. /// /// Implementations create a typedef called \c type so that we only need a @@ -68,9 +64,7 @@ template class SymbolTableList; // ItemParentClass - The type of object that owns the list, e.g. BasicBlock. // template -class SymbolTableListTraits - : public SymbolTableListSentinelTraits, - public ilist_node_traits { +class SymbolTableListTraits : public ilist_node_traits { typedef SymbolTableList ListTy; typedef typename SymbolTableListParentType::type ItemParentClass; diff --git a/llvm/include/llvm/MC/MCFragment.h b/llvm/include/llvm/MC/MCFragment.h index e0a2bfc2374767e53457680f7c428e766e6d2396..22e90e20aa96a1888b11c539e70c63d729a9287d 100644 --- a/llvm/include/llvm/MC/MCFragment.h +++ b/llvm/include/llvm/MC/MCFragment.h @@ -25,6 +25,7 @@ class MCSubtargetInfo; class MCFragment : public ilist_node_with_parent { friend class MCAsmLayout; + MCFragment() = delete; MCFragment(const MCFragment &) = delete; void operator=(const MCFragment &) = delete; @@ -83,11 +84,6 @@ protected: uint8_t BundlePadding, MCSection *Parent = nullptr); ~MCFragment(); -private: - - // This is a friend so that the sentinal can be created. - friend struct ilist_sentinel_traits; - MCFragment(); public: /// Destroys the current fragment. diff --git a/llvm/include/llvm/Transforms/Utils/MemorySSA.h b/llvm/include/llvm/Transforms/Utils/MemorySSA.h index 3a28b1c915bffa89b7effcb8b02a98e93fcd95b7..40b065ed792e4415b465b575d1ba989a25b16eeb 100644 --- a/llvm/include/llvm/Transforms/Utils/MemorySSA.h +++ b/llvm/include/llvm/Transforms/Utils/MemorySSA.h @@ -170,10 +170,6 @@ private: BasicBlock *Block; }; -template <> -struct ilist_sentinel_traits - : public ilist_half_embedded_sentinel_traits {}; - inline raw_ostream &operator<<(raw_ostream &OS, const MemoryAccess &MA) { MA.print(OS); return OS; diff --git a/llvm/lib/MC/MCFragment.cpp b/llvm/lib/MC/MCFragment.cpp index eae0dfe568e9568dd40d8c26c6294ec7c95c8e7e..638d91033363c7a3571f8893db9675afbd0a742a 100644 --- a/llvm/lib/MC/MCFragment.cpp +++ b/llvm/lib/MC/MCFragment.cpp @@ -235,10 +235,6 @@ void ilist_node_traits::deleteNode(MCFragment *V) { V->destroy(); } -MCFragment::MCFragment() : Kind(FragmentType(~0)), HasInstructions(false), - AlignToBundleEnd(false), BundlePadding(0) { -} - MCFragment::~MCFragment() { } MCFragment::MCFragment(FragmentType Kind, bool HasInstructions, diff --git a/llvm/lib/Support/YAMLParser.cpp b/llvm/lib/Support/YAMLParser.cpp index 4d5b750e2669246ed929173a7f244bc88ad1fab2..7490f1a9708690598b5b886e264a443abd622bd8 100644 --- a/llvm/lib/Support/YAMLParser.cpp +++ b/llvm/lib/Support/YAMLParser.cpp @@ -149,10 +149,6 @@ struct Token : ilist_node { } namespace llvm { -template <> -struct ilist_sentinel_traits - : public ilist_full_embedded_sentinel_traits {}; - template<> struct ilist_node_traits { Token *createNode(const Token &V) {