llvm.org GIT mirror llvm / d47df87
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279473 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan P. N. Exon Smith 3 years ago
18 changed file(s) with 3 addition(s) and 80 deletion(s). Raw diff Collapse all Expand all
5454 // Index of Element in terms of where first bit starts.
5555 unsigned ElementIndex;
5656 BitWord Bits[BITWORDS_PER_ELEMENT];
57 // Needed for sentinels
58 friend struct ilist_sentinel_traits;
5957 SparseBitVectorElement() {
6058 ElementIndex = ~0U;
6159 memset(&Bits[0], 0, sizeof (BitWord) * BITWORDS_PER_ELEMENT);
242240 BecameZero = allzero;
243241 }
244242 };
245
246 template
247 struct ilist_sentinel_traits>
248 : public ilist_half_embedded_sentinel_traits<
249 SparseBitVectorElement> {};
250243
251244 template
252245 class SparseBitVector {
117117 } // end namespace ilist_detail
118118
119119 template struct ilist_traits;
120
121 // TODO: Delete uses from subprojects, then delete these.
122 template struct ilist_sentinel_traits {};
123 template struct ilist_embedded_sentinel_traits {};
124 template struct ilist_half_embedded_sentinel_traits {};
125 template struct ilist_full_embedded_sentinel_traits {};
126120
127121 /// ilist_node_traits - A fragment for template traits for intrusive list
128122 /// that provides default node related operations.
2020
2121 template
2222 struct ilist_traits;
23 template struct ilist_embedded_sentinel_traits;
24 template struct ilist_half_embedded_sentinel_traits;
2523
2624 /// Base class for ilist nodes.
2725 struct ilist_node_base {
5452 template class ilist_node : ilist_node_base {
5553 friend struct ilist_node_access;
5654 friend struct ilist_traits;
57 friend struct ilist_half_embedded_sentinel_traits;
58 friend struct ilist_embedded_sentinel_traits;
5955 friend class ilist_iterator;
6056 friend class ilist_sentinel;
6157
238238 };
239239
240240 private:
241 // Can only be created by AliasSetTracker. Also, ilist creates one
242 // to serve as a sentinel.
243 friend struct ilist_sentinel_traits;
241 // Can only be created by AliasSetTracker.
244242 AliasSet()
245243 : PtrList(nullptr), PtrListEnd(&PtrList), Forward(nullptr), RefCount(0),
246244 AliasAny(false), Access(NoAccess), Alias(SetMustAlias),
8989 /// receive notification when the User is deleted.
9090 void deleted() override;
9191 };
92
93 template <>
94 struct ilist_sentinel_traits
95 : public ilist_embedded_sentinel_traits {};
9692
9793 class IVUsers {
9894 friend class IVStrideUse;
3636
3737 // Forward declaration to avoid circular include problem with TargetRegisterInfo
3838 typedef unsigned LaneBitmask;
39
40 template <>
41 struct ilist_sentinel_traits
42 : public ilist_half_embedded_sentinel_traits {};
4339
4440 template <>
4541 struct ilist_traits : public ilist_default_traits {
4646 class TargetRegisterClass;
4747 struct MachinePointerInfo;
4848 struct WinEHFuncInfo;
49
50 template <>
51 struct ilist_sentinel_traits
52 : public ilist_half_embedded_sentinel_traits {};
5349
5450 template <>
5551 struct ilist_traits
7979 return X.HashValue;
8080 }
8181 };
82
83 template <>
84 struct ilist_sentinel_traits
85 : public ilist_half_embedded_sentinel_traits {};
8682
8783 template <> struct ilist_traits : public ilist_default_traits {
8884 static void deleteNode(SDNode *) {
6666 bool isPoisoned() const { return (reinterpret_cast(mi) & 0x1) == 0x1; }
6767 #endif // EXPENSIVE_CHECKS
6868 };
69
70 template <>
71 struct ilist_sentinel_traits
72 : public ilist_half_embedded_sentinel_traits {};
7369
7470 template <>
7571 struct ilist_traits
2828 class LLVMContext;
2929 class BlockAddress;
3030 class Function;
31
32 template <>
33 struct SymbolTableListSentinelTraits
34 : public ilist_half_embedded_sentinel_traits {};
3531
3632 /// \brief LLVM Basic Block Representation
3733 ///
3333 class LLVMContext;
3434 class DISubprogram;
3535
36 template <>
37 struct SymbolTableListSentinelTraits
38 : public ilist_half_embedded_sentinel_traits {};
39
4036 class Function : public GlobalObject, public ilist_node {
4137 public:
4238 typedef SymbolTableList ArgumentListType;
2727 class MDNode;
2828 class BasicBlock;
2929 struct AAMDNodes;
30
31 template <>
32 struct SymbolTableListSentinelTraits
33 : public ilist_half_embedded_sentinel_traits {};
3430
3531 class Instruction : public User,
3632 public ilist_node_with_parent {
3535 class RandomNumberGenerator;
3636 class StructType;
3737 template class SmallPtrSetImpl;
38
39 template <>
40 struct ilist_sentinel_traits
41 : public ilist_embedded_sentinel_traits {};
4238
4339 template<> struct ilist_traits
4440 : public ilist_default_traits {
3333 template class iplist;
3434 template struct ilist_traits;
3535
36 template
37 struct SymbolTableListSentinelTraits
38 : public ilist_embedded_sentinel_traits {};
39
4036 /// Template metafunction to get the parent type for a symbol table list.
4137 ///
4238 /// Implementations create a typedef called \c type so that we only need a
6763 // ItemParentClass - The type of object that owns the list, e.g. BasicBlock.
6864 //
6965 template
70 class SymbolTableListTraits
71 : public SymbolTableListSentinelTraits,
72 public ilist_node_traits {
66 class SymbolTableListTraits : public ilist_node_traits {
7367 typedef SymbolTableList ListTy;
7468 typedef
7569 typename SymbolTableListParentType::type ItemParentClass;
2424 class MCFragment : public ilist_node_with_parent {
2525 friend class MCAsmLayout;
2626
27 MCFragment() = delete;
2728 MCFragment(const MCFragment &) = delete;
2829 void operator=(const MCFragment &) = delete;
2930
8283 uint8_t BundlePadding, MCSection *Parent = nullptr);
8384
8485 ~MCFragment();
85 private:
86
87 // This is a friend so that the sentinal can be created.
88 friend struct ilist_sentinel_traits;
89 MCFragment();
9086
9187 public:
9288 /// Destroys the current fragment.
169169 BasicBlock *Block;
170170 };
171171
172 template <>
173 struct ilist_sentinel_traits
174 : public ilist_half_embedded_sentinel_traits {};
175
176172 inline raw_ostream &operator<<(raw_ostream &OS, const MemoryAccess &MA) {
177173 MA.print(OS);
178174 return OS;
234234 V->destroy();
235235 }
236236
237 MCFragment::MCFragment() : Kind(FragmentType(~0)), HasInstructions(false),
238 AlignToBundleEnd(false), BundlePadding(0) {
239 }
240
241237 MCFragment::~MCFragment() { }
242238
243239 MCFragment::MCFragment(FragmentType Kind, bool HasInstructions,
148148 }
149149
150150 namespace llvm {
151 template <>
152 struct ilist_sentinel_traits
153 : public ilist_full_embedded_sentinel_traits {};
154
155151 template<>
156152 struct ilist_node_traits {
157153 Token *createNode(const Token &V) {