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 | 804c95df52ebfba155aa5697aeb283adcd28477a (patch) | |
tree | c3bdab8fada8c2fa76f62c12ee40275667d6ed02 /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 813bf7af7f62c0a8cff9bcefadab766cd85641c2 (diff) | |
download | bcm5719-llvm-804c95df52ebfba155aa5697aeb283adcd28477a.tar.gz bcm5719-llvm-804c95df52ebfba155aa5697aeb283adcd28477a.zip |
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.
llvm-svn: 54146
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index d5775826370..c952293976e 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -322,7 +322,7 @@ MachineInstr::MachineInstr(MachineFunction &MF, const MachineInstr &MI) NumImplicitOps = MI.NumImplicitOps; // Add memory operands. - for (alist<MachineMemOperand>::const_iterator i = MI.memoperands_begin(), + for (std::list<MachineMemOperand>::const_iterator i = MI.memoperands_begin(), j = MI.memoperands_end(); i != j; ++i) addMemOperand(MF, *i); @@ -506,13 +506,12 @@ void MachineInstr::RemoveOperand(unsigned OpNo) { /// referencing arbitrary storage. void MachineInstr::addMemOperand(MachineFunction &MF, const MachineMemOperand &MO) { - MemOperands.push_back(MF.CreateMachineMemOperand(MO)); + MemOperands.push_back(MO); } /// clearMemOperands - Erase all of this MachineInstr's MachineMemOperands. void MachineInstr::clearMemOperands(MachineFunction &MF) { - while (!MemOperands.empty()) - MF.DeleteMachineMemOperand(MemOperands.remove(MemOperands.begin())); + MemOperands.clear(); } @@ -731,7 +730,7 @@ void MachineInstr::print(std::ostream &OS, const TargetMachine *TM) const { if (!memoperands_empty()) { OS << ", Mem:"; - for (alist<MachineMemOperand>::const_iterator i = memoperands_begin(), + for (std::list<MachineMemOperand>::const_iterator i = memoperands_begin(), e = memoperands_end(); i != e; ++i) { const MachineMemOperand &MRO = *i; const Value *V = MRO.getValue(); |