[llvm] r279473 - ADT: Remove ilist_*sentinel_traits, NFC

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 13:51:01 PDT 2016


Author: dexonsmith
Date: Mon Aug 22 15:51:00 2016
New Revision: 279473

URL: http://llvm.org/viewvc/llvm-project?rev=279473&view=rev
Log:
ADT: Remove ilist_*sentinel_traits, NFC

Remove all the dead code around ilist_*sentinel_traits.  This is a
follow-up to gutting them as part of r279314 (originally r278974),
staged to prevent broken builds in sub-projects.

Uses were removed from clang in r279457 and lld in r279458.

Modified:
    llvm/trunk/include/llvm/ADT/SparseBitVector.h
    llvm/trunk/include/llvm/ADT/ilist.h
    llvm/trunk/include/llvm/ADT/ilist_node.h
    llvm/trunk/include/llvm/Analysis/AliasSetTracker.h
    llvm/trunk/include/llvm/Analysis/IVUsers.h
    llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h
    llvm/trunk/include/llvm/CodeGen/MachineFunction.h
    llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
    llvm/trunk/include/llvm/CodeGen/SlotIndexes.h
    llvm/trunk/include/llvm/IR/BasicBlock.h
    llvm/trunk/include/llvm/IR/Function.h
    llvm/trunk/include/llvm/IR/Instruction.h
    llvm/trunk/include/llvm/IR/Module.h
    llvm/trunk/include/llvm/IR/SymbolTableListTraits.h
    llvm/trunk/include/llvm/MC/MCFragment.h
    llvm/trunk/include/llvm/Transforms/Utils/MemorySSA.h
    llvm/trunk/lib/MC/MCFragment.cpp
    llvm/trunk/lib/Support/YAMLParser.cpp

Modified: llvm/trunk/include/llvm/ADT/SparseBitVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SparseBitVector.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SparseBitVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SparseBitVector.h Mon Aug 22 15:51:00 2016
@@ -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>;
   SparseBitVectorElement() {
     ElementIndex = ~0U;
     memset(&Bits[0], 0, sizeof (BitWord) * BITWORDS_PER_ELEMENT);
@@ -244,11 +242,6 @@ public:
   }
 };
 
-template <unsigned ElementSize>
-struct ilist_sentinel_traits<SparseBitVectorElement<ElementSize>>
-    : public ilist_half_embedded_sentinel_traits<
-          SparseBitVectorElement<ElementSize>> {};
-
 template <unsigned ElementSize = 128>
 class SparseBitVector {
   typedef ilist<SparseBitVectorElement<ElementSize> > ElementList;

Modified: llvm/trunk/include/llvm/ADT/ilist.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ilist.h (original)
+++ llvm/trunk/include/llvm/ADT/ilist.h Mon Aug 22 15:51:00 2016
@@ -119,12 +119,6 @@ template <class TraitsT, class NodeT> st
 
 template <typename NodeTy> struct ilist_traits;
 
-// TODO: Delete uses from subprojects, then delete these.
-template <typename NodeTy> struct ilist_sentinel_traits {};
-template <typename NodeTy> struct ilist_embedded_sentinel_traits {};
-template <typename NodeTy> struct ilist_half_embedded_sentinel_traits {};
-template <typename NodeTy> struct ilist_full_embedded_sentinel_traits {};
-
 /// ilist_node_traits - A fragment for template traits for intrusive list
 /// that provides default node related operations.
 ///

Modified: llvm/trunk/include/llvm/ADT/ilist_node.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist_node.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ilist_node.h (original)
+++ llvm/trunk/include/llvm/ADT/ilist_node.h Mon Aug 22 15:51:00 2016
@@ -21,8 +21,6 @@ namespace llvm {
 
 template<typename NodeTy>
 struct ilist_traits;
-template <typename NodeTy> struct ilist_embedded_sentinel_traits;
-template <typename NodeTy> struct ilist_half_embedded_sentinel_traits;
 
 /// Base class for ilist nodes.
 struct ilist_node_base {
@@ -55,8 +53,6 @@ template <typename NodeTy> class ilist_s
 template <typename NodeTy> class ilist_node : ilist_node_base {
   friend struct ilist_node_access;
   friend struct ilist_traits<NodeTy>;
-  friend struct ilist_half_embedded_sentinel_traits<NodeTy>;
-  friend struct ilist_embedded_sentinel_traits<NodeTy>;
   friend class ilist_iterator<NodeTy>;
   friend class ilist_sentinel<NodeTy>;
 

Modified: llvm/trunk/include/llvm/Analysis/AliasSetTracker.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasSetTracker.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/AliasSetTracker.h (original)
+++ llvm/trunk/include/llvm/Analysis/AliasSetTracker.h Mon Aug 22 15:51:00 2016
@@ -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<AliasSet>;
+  // Can only be created by AliasSetTracker.
   AliasSet()
       : PtrList(nullptr), PtrListEnd(&PtrList), Forward(nullptr), RefCount(0),
         AliasAny(false), Access(NoAccess), Alias(SetMustAlias),

Modified: llvm/trunk/include/llvm/Analysis/IVUsers.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/IVUsers.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/IVUsers.h (original)
+++ llvm/trunk/include/llvm/Analysis/IVUsers.h Mon Aug 22 15:51:00 2016
@@ -91,10 +91,6 @@ private:
   void deleted() override;
 };
 
-template <>
-struct ilist_sentinel_traits<IVStrideUse>
-    : public ilist_embedded_sentinel_traits<IVStrideUse> {};
-
 class IVUsers {
   friend class IVStrideUse;
   Loop *L;

Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Mon Aug 22 15:51:00 2016
@@ -39,10 +39,6 @@ class MachineBranchProbabilityInfo;
 typedef unsigned LaneBitmask;
 
 template <>
-struct ilist_sentinel_traits<MachineInstr>
-    : public ilist_half_embedded_sentinel_traits<MachineInstr> {};
-
-template <>
 struct ilist_traits<MachineInstr> : public ilist_default_traits<MachineInstr> {
 private:
   // this is only set by the MachineBasicBlock owning the LiveList

Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Mon Aug 22 15:51:00 2016
@@ -49,10 +49,6 @@ struct MachinePointerInfo;
 struct WinEHFuncInfo;
 
 template <>
-struct ilist_sentinel_traits<MachineBasicBlock>
-    : public ilist_half_embedded_sentinel_traits<MachineBasicBlock> {};
-
-template <>
 struct ilist_traits<MachineBasicBlock>
     : public ilist_default_traits<MachineBasicBlock> {
   void addNodeToList(MachineBasicBlock* MBB);

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Mon Aug 22 15:51:00 2016
@@ -81,10 +81,6 @@ template<> struct FoldingSetTrait<SDVTLi
   }
 };
 
-template <>
-struct ilist_sentinel_traits<SDNode>
-    : public ilist_half_embedded_sentinel_traits<SDNode> {};
-
 template <> struct ilist_traits<SDNode> : public ilist_default_traits<SDNode> {
   static void deleteNode(SDNode *) {
     llvm_unreachable("ilist_traits<SDNode> shouldn't see a deleteNode call!");

Modified: llvm/trunk/include/llvm/CodeGen/SlotIndexes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SlotIndexes.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SlotIndexes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SlotIndexes.h Mon Aug 22 15:51:00 2016
@@ -69,10 +69,6 @@ namespace llvm {
   };
 
   template <>
-  struct ilist_sentinel_traits<IndexListEntry>
-      : public ilist_half_embedded_sentinel_traits<IndexListEntry> {};
-
-  template <>
   struct ilist_traits<IndexListEntry>
       : public ilist_default_traits<IndexListEntry> {
     void deleteNode(IndexListEntry *N) {}

Modified: llvm/trunk/include/llvm/IR/BasicBlock.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/BasicBlock.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/BasicBlock.h (original)
+++ llvm/trunk/include/llvm/IR/BasicBlock.h Mon Aug 22 15:51:00 2016
@@ -30,10 +30,6 @@ class LLVMContext;
 class BlockAddress;
 class Function;
 
-template <>
-struct SymbolTableListSentinelTraits<BasicBlock>
-    : public ilist_half_embedded_sentinel_traits<BasicBlock> {};
-
 /// \brief LLVM Basic Block Representation
 ///
 /// This represents a single basic block in LLVM. A basic block is simply a

Modified: llvm/trunk/include/llvm/IR/Function.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Function.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Function.h (original)
+++ llvm/trunk/include/llvm/IR/Function.h Mon Aug 22 15:51:00 2016
@@ -34,10 +34,6 @@ class FunctionType;
 class LLVMContext;
 class DISubprogram;
 
-template <>
-struct SymbolTableListSentinelTraits<Argument>
-    : public ilist_half_embedded_sentinel_traits<Argument> {};
-
 class Function : public GlobalObject, public ilist_node<Function> {
 public:
   typedef SymbolTableList<Argument> ArgumentListType;

Modified: llvm/trunk/include/llvm/IR/Instruction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Instruction.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Instruction.h (original)
+++ llvm/trunk/include/llvm/IR/Instruction.h Mon Aug 22 15:51:00 2016
@@ -29,10 +29,6 @@ class MDNode;
 class BasicBlock;
 struct AAMDNodes;
 
-template <>
-struct SymbolTableListSentinelTraits<Instruction>
-    : public ilist_half_embedded_sentinel_traits<Instruction> {};
-
 class Instruction : public User,
                     public ilist_node_with_parent<Instruction, BasicBlock> {
   void operator=(const Instruction &) = delete;

Modified: llvm/trunk/include/llvm/IR/Module.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Module.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Module.h (original)
+++ llvm/trunk/include/llvm/IR/Module.h Mon Aug 22 15:51:00 2016
@@ -37,10 +37,6 @@ class RandomNumberGenerator;
 class StructType;
 template <class PtrType> class SmallPtrSetImpl;
 
-template <>
-struct ilist_sentinel_traits<NamedMDNode>
-    : public ilist_embedded_sentinel_traits<NamedMDNode> {};
-
 template<> struct ilist_traits<NamedMDNode>
   : public ilist_default_traits<NamedMDNode> {
   void addNodeToList(NamedMDNode *) {}

Modified: llvm/trunk/include/llvm/IR/SymbolTableListTraits.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/SymbolTableListTraits.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/SymbolTableListTraits.h (original)
+++ llvm/trunk/include/llvm/IR/SymbolTableListTraits.h Mon Aug 22 15:51:00 2016
@@ -34,10 +34,6 @@ template <typename NodeTy> class ilist_i
 template <typename NodeTy, typename Traits> class iplist;
 template <typename Ty> struct ilist_traits;
 
-template <typename NodeTy>
-struct SymbolTableListSentinelTraits
-    : public ilist_embedded_sentinel_traits<NodeTy> {};
-
 /// 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 <typename NodeTy> class SymbolT
 // ItemParentClass - The type of object that owns the list, e.g. BasicBlock.
 //
 template <typename ValueSubClass>
-class SymbolTableListTraits
-    : public SymbolTableListSentinelTraits<ValueSubClass>,
-      public ilist_node_traits<ValueSubClass> {
+class SymbolTableListTraits : public ilist_node_traits<ValueSubClass> {
   typedef SymbolTableList<ValueSubClass> ListTy;
   typedef
       typename SymbolTableListParentType<ValueSubClass>::type ItemParentClass;

Modified: llvm/trunk/include/llvm/MC/MCFragment.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCFragment.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCFragment.h (original)
+++ llvm/trunk/include/llvm/MC/MCFragment.h Mon Aug 22 15:51:00 2016
@@ -25,6 +25,7 @@ class MCSubtargetInfo;
 class MCFragment : public ilist_node_with_parent<MCFragment, MCSection> {
   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>;
-  MCFragment();
 
 public:
   /// Destroys the current fragment.

Modified: llvm/trunk/include/llvm/Transforms/Utils/MemorySSA.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/MemorySSA.h?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/MemorySSA.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/MemorySSA.h Mon Aug 22 15:51:00 2016
@@ -170,10 +170,6 @@ private:
   BasicBlock *Block;
 };
 
-template <>
-struct ilist_sentinel_traits<MemoryAccess>
-    : public ilist_half_embedded_sentinel_traits<MemoryAccess> {};
-
 inline raw_ostream &operator<<(raw_ostream &OS, const MemoryAccess &MA) {
   MA.print(OS);
   return OS;

Modified: llvm/trunk/lib/MC/MCFragment.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCFragment.cpp?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCFragment.cpp (original)
+++ llvm/trunk/lib/MC/MCFragment.cpp Mon Aug 22 15:51:00 2016
@@ -235,10 +235,6 @@ void ilist_node_traits<MCFragment>::dele
   V->destroy();
 }
 
-MCFragment::MCFragment() : Kind(FragmentType(~0)), HasInstructions(false),
-                           AlignToBundleEnd(false), BundlePadding(0) {
-}
-
 MCFragment::~MCFragment() { }
 
 MCFragment::MCFragment(FragmentType Kind, bool HasInstructions,

Modified: llvm/trunk/lib/Support/YAMLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/YAMLParser.cpp?rev=279473&r1=279472&r2=279473&view=diff
==============================================================================
--- llvm/trunk/lib/Support/YAMLParser.cpp (original)
+++ llvm/trunk/lib/Support/YAMLParser.cpp Mon Aug 22 15:51:00 2016
@@ -149,10 +149,6 @@ struct Token : ilist_node<Token> {
 }
 
 namespace llvm {
-template <>
-struct ilist_sentinel_traits<Token>
-    : public ilist_full_embedded_sentinel_traits<Token> {};
-
 template<>
 struct ilist_node_traits<Token> {
   Token *createNode(const Token &V) {




More information about the llvm-commits mailing list