From f947c3afe10cf4a8ca3574ddd4deee2032254c53 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Tue, 30 Aug 2016 18:40:47 +0000 Subject: ADT: Split ilist_node_traits into alloc and callback, NFC Many lists want to override only allocation semantics, or callbacks for iplist. Split these up to prevent code duplication. - Specialize ilist_alloc_traits to change the implementations of deleteNode() and createNode(). - One common desire is to do nothing deleteNode() and disable createNode(). Specialize ilist_alloc_traits to inherit from ilist_noalloc_traits for that behaviour. - Specialize ilist_callback_traits to use the addNodeToList(), removeNodeFromList(), and transferNodesFromList() callbacks. As a drive-by, add some coverage to the callback-related unit tests. llvm-svn: 280128 --- llvm/lib/CodeGen/MachineFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index c8039f5e876..7f1bb9294ad 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -86,7 +86,7 @@ void MachineFunctionProperties::print(raw_ostream &OS) const { // Out-of-line virtual method. MachineFunctionInfo::~MachineFunctionInfo() {} -void ilist_traits::deleteNode(MachineBasicBlock *MBB) { +void ilist_alloc_traits::deleteNode(MachineBasicBlock *MBB) { MBB->getParent()->DeleteMachineBasicBlock(MBB); } -- cgit v1.2.3