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 --- lib/CodeGen/MachineFunction.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'lib/CodeGen/MachineFunction.cpp') diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index 2cac96a4a8..b243297253 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -102,7 +102,7 @@ FunctionPass *llvm::createMachineCodeDeleter() { // MachineFunction implementation //===---------------------------------------------------------------------===// -void alist_traits::deleteNode(MachineBasicBlock *MBB) { +void ilist_traits::deleteNode(MachineBasicBlock *MBB) { MBB->getParent()->DeleteMachineBasicBlock(MBB); } @@ -131,7 +131,6 @@ MachineFunction::~MachineFunction() { BasicBlocks.clear(); InstructionRecycler.clear(Allocator); BasicBlockRecycler.clear(Allocator); - MemOperandRecycler.clear(Allocator); RegInfo->~MachineRegisterInfo(); Allocator.Deallocate(RegInfo); if (MFInfo) { MFInfo->~MachineFunctionInfo(); Allocator.Deallocate(MFInfo); @@ -234,23 +233,6 @@ MachineFunction::DeleteMachineBasicBlock(MachineBasicBlock *MBB) { BasicBlockRecycler.Deallocate(Allocator, MBB); } -/// CreateMachineMemOperand - Allocate a new MachineMemOperand. Use this -/// instead of `new MachineMemOperand'. -/// -MachineMemOperand * -MachineFunction::CreateMachineMemOperand(const MachineMemOperand &MMO) { - return new (MemOperandRecycler.Allocate(Allocator)) - MachineMemOperand(MMO); -} - -/// DeleteMachineMemOperand - Delete the given MachineMemOperand. -/// -void -MachineFunction::DeleteMachineMemOperand(MachineMemOperand *MO) { - MO->~MachineMemOperand(); - MemOperandRecycler.Deallocate(Allocator, MO); -} - void MachineFunction::dump() const { print(*cerr.stream()); } -- cgit v1.2.3-18-g5258