diff options
author | Dan Gohman <gohman@apple.com> | 2008-07-28 21:51:04 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-07-28 21:51:04 +0000 |
commit | fed90b6d097d50881afb45e4d79f430db66dd741 (patch) | |
tree | 7ec1a6f6b2a8a37e054b84505502b3346c6680c7 /include/llvm/BasicBlock.h | |
parent | 80e051dfdede65678ac66f1552278338bc1a1b33 (diff) | |
download | llvm-fed90b6d097d50881afb45e4d79f430db66dd741.tar.gz llvm-fed90b6d097d50881afb45e4d79f430db66dd741.tar.bz2 llvm-fed90b6d097d50881afb45e4d79f430db66dd741.tar.xz |
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
Diffstat (limited to 'include/llvm/BasicBlock.h')
-rw-r--r-- | include/llvm/BasicBlock.h | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h index 108f43a767..47478f2009 100644 --- a/include/llvm/BasicBlock.h +++ b/include/llvm/BasicBlock.h @@ -49,17 +49,15 @@ template<> struct ilist_traits<Instruction> /// modifying a program. However, the verifier will ensure that basic blocks /// are "well formed". /// @brief LLVM Basic Block Representation -class BasicBlock : public Value { // Basic blocks are data objects also +class BasicBlock : public Value, // Basic blocks are data objects also + public ilist_node<BasicBlock> { public: typedef iplist<Instruction> InstListType; private : InstListType InstList; - BasicBlock *Prev, *Next; // Next and Prev links for our intrusive linked list Function *Parent; void setParent(Function *parent); - void setNext(BasicBlock *N) { Next = N; } - void setPrev(BasicBlock *N) { Prev = N; } friend class SymbolTableListTraits<BasicBlock, Function>; BasicBlock(const BasicBlock &); // Do not implement @@ -204,14 +202,6 @@ public: BasicBlock *Obj = 0; return unsigned(reinterpret_cast<uintptr_t>(&Obj->InstList)); } - -private: - // getNext/Prev - Return the next or previous basic block in the list. Access - // these with Function::iterator. - BasicBlock *getNext() { return Next; } - const BasicBlock *getNext() const { return Next; } - BasicBlock *getPrev() { return Prev; } - const BasicBlock *getPrev() const { return Prev; } }; inline int |