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/CodeGen/MachineInstr.h | |
parent | 80e051dfdede65678ac66f1552278338bc1a1b33 (diff) |
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/CodeGen/MachineInstr.h')
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 31f4974699..bcbcf316d0 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -16,9 +16,12 @@ #ifndef LLVM_CODEGEN_MACHINEINSTR_H #define LLVM_CODEGEN_MACHINEINSTR_H -#include "llvm/ADT/alist.h" +#include "llvm/ADT/ilist.h" +#include "llvm/ADT/ilist_node.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineMemOperand.h" +#include <list> #include <vector> namespace llvm { @@ -31,13 +34,13 @@ class MachineFunction; //===----------------------------------------------------------------------===// /// MachineInstr - Representation of each machine instruction. /// -class MachineInstr { +class MachineInstr : public ilist_node<MachineInstr> { const TargetInstrDesc *TID; // Instruction descriptor. unsigned short NumImplicitOps; // Number of implicit operands (which // are determined at construction time). std::vector<MachineOperand> Operands; // the operands - alist<MachineMemOperand> MemOperands; // information on memory references + std::list<MachineMemOperand> MemOperands; // information on memory references MachineBasicBlock *Parent; // Pointer to the owning basic block. // OperandComplete - Return true if it's illegal to add a new operand @@ -47,8 +50,9 @@ class MachineInstr { void operator=(const MachineInstr&); // DO NOT IMPLEMENT // Intrusive list support - friend struct alist_traits<MachineInstr>; - friend struct alist_traits<MachineBasicBlock>; + friend struct ilist_traits<MachineInstr>; + friend struct ilist_traits<MachineBasicBlock>; + friend struct ilist_sentinel_traits<MachineInstr>; void setParent(MachineBasicBlock *P) { Parent = P; } /// MachineInstr ctor - This constructor creates a copy of the given @@ -105,13 +109,13 @@ public: unsigned getNumExplicitOperands() const; /// Access to memory operands of the instruction - alist<MachineMemOperand>::iterator memoperands_begin() + std::list<MachineMemOperand>::iterator memoperands_begin() { return MemOperands.begin(); } - alist<MachineMemOperand>::iterator memoperands_end() + std::list<MachineMemOperand>::iterator memoperands_end() { return MemOperands.end(); } - alist<MachineMemOperand>::const_iterator memoperands_begin() const + std::list<MachineMemOperand>::const_iterator memoperands_begin() const { return MemOperands.begin(); } - alist<MachineMemOperand>::const_iterator memoperands_end() const + std::list<MachineMemOperand>::const_iterator memoperands_end() const { return MemOperands.end(); } bool memoperands_empty() const { return MemOperands.empty(); } |