From fed90b6d097d50881afb45e4d79f430db66dd741 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 28 Jul 2008 21:51:04 +0000 Subject: Fold the useful features of alist and alist_node into ilist, and a new ilist_node class, and remove them. Unlike alist_node, ilist_node doesn't attempt to manage storage itself, so it avoids the associated problems, including being opaque in gdb. Adjust the Recycler class so that it doesn't depend on alist_node. Also, change it to use explicit Size and Align parameters, allowing it to work when the largest-sized node doesn't have the greatest alignment requirement. Change MachineInstr's MachineMemOperand list from a pool-backed alist to a std::list for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54146 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/AliasSetTracker.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'include/llvm/Analysis') diff --git a/include/llvm/Analysis/AliasSetTracker.h b/include/llvm/Analysis/AliasSetTracker.h index d9e45ce9a1..2dcc2bebe0 100644 --- a/include/llvm/Analysis/AliasSetTracker.h +++ b/include/llvm/Analysis/AliasSetTracker.h @@ -22,6 +22,7 @@ #include "llvm/ADT/iterator.h" #include "llvm/ADT/hash_map.h" #include "llvm/ADT/ilist.h" +#include "llvm/ADT/ilist_node.h" namespace llvm { @@ -33,7 +34,7 @@ class VAArgInst; class AliasSetTracker; class AliasSet; -class AliasSet { +class AliasSet : public ilist_node { friend class AliasSetTracker; class PointerRec; @@ -118,12 +119,6 @@ class AliasSet { // Volatile - True if this alias set contains volatile loads or stores. bool Volatile : 1; - friend struct ilist_traits; - AliasSet *getPrev() const { return Prev; } - AliasSet *getNext() const { return Next; } - void setPrev(AliasSet *P) { Prev = P; } - void setNext(AliasSet *N) { Next = N; } - void addRef() { ++RefCount; } void dropRef(AliasSetTracker &AST) { assert(RefCount >= 1 && "Invalid reference count detected!"); @@ -197,15 +192,15 @@ public: }; private: - // Can only be created by AliasSetTracker + // Can only be created by AliasSetTracker. Also, ilist creates one + // to serve as a sentinel. + friend struct ilist_sentinel_traits; AliasSet() : PtrList(0), PtrListEnd(&PtrList), Forward(0), RefCount(0), AccessTy(NoModRef), AliasTy(MustAlias), Volatile(false) { } - AliasSet(const AliasSet &AS) { - assert(0 && "Copy ctor called!?!?!"); - abort(); - } + AliasSet(const AliasSet &AS); // do not implement + void operator=(const AliasSet &AS); // do not implement HashNodePair *getSomePointer() const { return PtrList; -- cgit v1.2.3