1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

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.

llvm-svn: 279473
This commit is contained in:
Duncan P. N. Exon Smith 2016-08-22 20:51:00 +00:00
parent 1634b27769
commit 68b6058de5
18 changed files with 3 additions and 80 deletions

View File

@ -55,8 +55,6 @@ private:
// Index of Element in terms of where first bit starts. // Index of Element in terms of where first bit starts.
unsigned ElementIndex; unsigned ElementIndex;
BitWord Bits[BITWORDS_PER_ELEMENT]; BitWord Bits[BITWORDS_PER_ELEMENT];
// Needed for sentinels
friend struct ilist_sentinel_traits<SparseBitVectorElement>;
SparseBitVectorElement() { SparseBitVectorElement() {
ElementIndex = ~0U; ElementIndex = ~0U;
memset(&Bits[0], 0, sizeof (BitWord) * BITWORDS_PER_ELEMENT); 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> template <unsigned ElementSize = 128>
class SparseBitVector { class SparseBitVector {
typedef ilist<SparseBitVectorElement<ElementSize> > ElementList; typedef ilist<SparseBitVectorElement<ElementSize> > ElementList;

View File

@ -119,12 +119,6 @@ template <class TraitsT, class NodeT> struct HasObsoleteCustomization {
template <typename NodeTy> struct ilist_traits; 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 /// ilist_node_traits - A fragment for template traits for intrusive list
/// that provides default node related operations. /// that provides default node related operations.
/// ///

View File

@ -21,8 +21,6 @@ namespace llvm {
template<typename NodeTy> template<typename NodeTy>
struct ilist_traits; 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. /// Base class for ilist nodes.
struct ilist_node_base { struct ilist_node_base {
@ -55,8 +53,6 @@ template <typename NodeTy> class ilist_sentinel;
template <typename NodeTy> class ilist_node : ilist_node_base { template <typename NodeTy> class ilist_node : ilist_node_base {
friend struct ilist_node_access; friend struct ilist_node_access;
friend struct ilist_traits<NodeTy>; 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_iterator<NodeTy>;
friend class ilist_sentinel<NodeTy>; friend class ilist_sentinel<NodeTy>;

View File

@ -239,9 +239,7 @@ public:
}; };
private: private:
// Can only be created by AliasSetTracker. Also, ilist creates one // Can only be created by AliasSetTracker.
// to serve as a sentinel.
friend struct ilist_sentinel_traits<AliasSet>;
AliasSet() AliasSet()
: PtrList(nullptr), PtrListEnd(&PtrList), Forward(nullptr), RefCount(0), : PtrList(nullptr), PtrListEnd(&PtrList), Forward(nullptr), RefCount(0),
AliasAny(false), Access(NoAccess), Alias(SetMustAlias), AliasAny(false), Access(NoAccess), Alias(SetMustAlias),

View File

@ -91,10 +91,6 @@ private:
void deleted() override; void deleted() override;
}; };
template <>
struct ilist_sentinel_traits<IVStrideUse>
: public ilist_embedded_sentinel_traits<IVStrideUse> {};
class IVUsers { class IVUsers {
friend class IVStrideUse; friend class IVStrideUse;
Loop *L; Loop *L;

View File

@ -38,10 +38,6 @@ class MachineBranchProbabilityInfo;
// Forward declaration to avoid circular include problem with TargetRegisterInfo // Forward declaration to avoid circular include problem with TargetRegisterInfo
typedef unsigned LaneBitmask; typedef unsigned LaneBitmask;
template <>
struct ilist_sentinel_traits<MachineInstr>
: public ilist_half_embedded_sentinel_traits<MachineInstr> {};
template <> template <>
struct ilist_traits<MachineInstr> : public ilist_default_traits<MachineInstr> { struct ilist_traits<MachineInstr> : public ilist_default_traits<MachineInstr> {
private: private:

View File

@ -48,10 +48,6 @@ class TargetRegisterClass;
struct MachinePointerInfo; struct MachinePointerInfo;
struct WinEHFuncInfo; struct WinEHFuncInfo;
template <>
struct ilist_sentinel_traits<MachineBasicBlock>
: public ilist_half_embedded_sentinel_traits<MachineBasicBlock> {};
template <> template <>
struct ilist_traits<MachineBasicBlock> struct ilist_traits<MachineBasicBlock>
: public ilist_default_traits<MachineBasicBlock> { : public ilist_default_traits<MachineBasicBlock> {

View File

@ -81,10 +81,6 @@ template<> struct FoldingSetTrait<SDVTListNode> : DefaultFoldingSetTrait<SDVTLis
} }
}; };
template <>
struct ilist_sentinel_traits<SDNode>
: public ilist_half_embedded_sentinel_traits<SDNode> {};
template <> struct ilist_traits<SDNode> : public ilist_default_traits<SDNode> { template <> struct ilist_traits<SDNode> : public ilist_default_traits<SDNode> {
static void deleteNode(SDNode *) { static void deleteNode(SDNode *) {
llvm_unreachable("ilist_traits<SDNode> shouldn't see a deleteNode call!"); llvm_unreachable("ilist_traits<SDNode> shouldn't see a deleteNode call!");

View File

@ -68,10 +68,6 @@ namespace llvm {
#endif // EXPENSIVE_CHECKS #endif // EXPENSIVE_CHECKS
}; };
template <>
struct ilist_sentinel_traits<IndexListEntry>
: public ilist_half_embedded_sentinel_traits<IndexListEntry> {};
template <> template <>
struct ilist_traits<IndexListEntry> struct ilist_traits<IndexListEntry>
: public ilist_default_traits<IndexListEntry> { : public ilist_default_traits<IndexListEntry> {

View File

@ -30,10 +30,6 @@ class LLVMContext;
class BlockAddress; class BlockAddress;
class Function; class Function;
template <>
struct SymbolTableListSentinelTraits<BasicBlock>
: public ilist_half_embedded_sentinel_traits<BasicBlock> {};
/// \brief LLVM Basic Block Representation /// \brief LLVM Basic Block Representation
/// ///
/// This represents a single basic block in LLVM. A basic block is simply a /// This represents a single basic block in LLVM. A basic block is simply a

View File

@ -34,10 +34,6 @@ class FunctionType;
class LLVMContext; class LLVMContext;
class DISubprogram; class DISubprogram;
template <>
struct SymbolTableListSentinelTraits<Argument>
: public ilist_half_embedded_sentinel_traits<Argument> {};
class Function : public GlobalObject, public ilist_node<Function> { class Function : public GlobalObject, public ilist_node<Function> {
public: public:
typedef SymbolTableList<Argument> ArgumentListType; typedef SymbolTableList<Argument> ArgumentListType;

View File

@ -29,10 +29,6 @@ class MDNode;
class BasicBlock; class BasicBlock;
struct AAMDNodes; struct AAMDNodes;
template <>
struct SymbolTableListSentinelTraits<Instruction>
: public ilist_half_embedded_sentinel_traits<Instruction> {};
class Instruction : public User, class Instruction : public User,
public ilist_node_with_parent<Instruction, BasicBlock> { public ilist_node_with_parent<Instruction, BasicBlock> {
void operator=(const Instruction &) = delete; void operator=(const Instruction &) = delete;

View File

@ -37,10 +37,6 @@ class RandomNumberGenerator;
class StructType; class StructType;
template <class PtrType> class SmallPtrSetImpl; template <class PtrType> class SmallPtrSetImpl;
template <>
struct ilist_sentinel_traits<NamedMDNode>
: public ilist_embedded_sentinel_traits<NamedMDNode> {};
template<> struct ilist_traits<NamedMDNode> template<> struct ilist_traits<NamedMDNode>
: public ilist_default_traits<NamedMDNode> { : public ilist_default_traits<NamedMDNode> {
void addNodeToList(NamedMDNode *) {} void addNodeToList(NamedMDNode *) {}

View File

@ -34,10 +34,6 @@ template <typename NodeTy> class ilist_iterator;
template <typename NodeTy, typename Traits> class iplist; template <typename NodeTy, typename Traits> class iplist;
template <typename Ty> struct ilist_traits; 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. /// 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 /// Implementations create a typedef called \c type so that we only need a
@ -68,9 +64,7 @@ template <typename NodeTy> class SymbolTableList;
// ItemParentClass - The type of object that owns the list, e.g. BasicBlock. // ItemParentClass - The type of object that owns the list, e.g. BasicBlock.
// //
template <typename ValueSubClass> template <typename ValueSubClass>
class SymbolTableListTraits class SymbolTableListTraits : public ilist_node_traits<ValueSubClass> {
: public SymbolTableListSentinelTraits<ValueSubClass>,
public ilist_node_traits<ValueSubClass> {
typedef SymbolTableList<ValueSubClass> ListTy; typedef SymbolTableList<ValueSubClass> ListTy;
typedef typedef
typename SymbolTableListParentType<ValueSubClass>::type ItemParentClass; typename SymbolTableListParentType<ValueSubClass>::type ItemParentClass;

View File

@ -25,6 +25,7 @@ class MCSubtargetInfo;
class MCFragment : public ilist_node_with_parent<MCFragment, MCSection> { class MCFragment : public ilist_node_with_parent<MCFragment, MCSection> {
friend class MCAsmLayout; friend class MCAsmLayout;
MCFragment() = delete;
MCFragment(const MCFragment &) = delete; MCFragment(const MCFragment &) = delete;
void operator=(const MCFragment &) = delete; void operator=(const MCFragment &) = delete;
@ -83,11 +84,6 @@ protected:
uint8_t BundlePadding, MCSection *Parent = nullptr); uint8_t BundlePadding, MCSection *Parent = nullptr);
~MCFragment(); ~MCFragment();
private:
// This is a friend so that the sentinal can be created.
friend struct ilist_sentinel_traits<MCFragment>;
MCFragment();
public: public:
/// Destroys the current fragment. /// Destroys the current fragment.

View File

@ -170,10 +170,6 @@ private:
BasicBlock *Block; 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) { inline raw_ostream &operator<<(raw_ostream &OS, const MemoryAccess &MA) {
MA.print(OS); MA.print(OS);
return OS; return OS;

View File

@ -235,10 +235,6 @@ void ilist_node_traits<MCFragment>::deleteNode(MCFragment *V) {
V->destroy(); V->destroy();
} }
MCFragment::MCFragment() : Kind(FragmentType(~0)), HasInstructions(false),
AlignToBundleEnd(false), BundlePadding(0) {
}
MCFragment::~MCFragment() { } MCFragment::~MCFragment() { }
MCFragment::MCFragment(FragmentType Kind, bool HasInstructions, MCFragment::MCFragment(FragmentType Kind, bool HasInstructions,

View File

@ -149,10 +149,6 @@ struct Token : ilist_node<Token> {
} }
namespace llvm { namespace llvm {
template <>
struct ilist_sentinel_traits<Token>
: public ilist_full_embedded_sentinel_traits<Token> {};
template<> template<>
struct ilist_node_traits<Token> { struct ilist_node_traits<Token> {
Token *createNode(const Token &V) { Token *createNode(const Token &V) {