From d6f8e4b03cb1f33294cfa4da8d1def26ad884e15 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Thu, 11 Dec 2014 21:51:37 +0000 Subject: CodeGen: Stop using LeakDetector for MachineInstr Since `MachineInstr` is required to have a trivial destructor, it cannot remove itself from `LeakDetection`. Remove the calls. As it happens, this requirement is because `MachineFunction` allocates all `MachineInstr`s in a custom allocator; when the `MachineFunction` is destroyed they're dropped of the edge. There's no benefit to detecting leaks. llvm-svn: 224061 --- llvm/lib/CodeGen/MachineBasicBlock.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp') diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 36ae30940fa8..a7dc1b328c1b 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -107,8 +107,6 @@ void ilist_traits::addNodeToList(MachineInstr *N) { // use/def lists. MachineFunction *MF = Parent->getParent(); N->AddRegOperandsToUseLists(MF->getRegInfo()); - - LeakDetector::removeGarbageObject(N); } /// removeNodeFromList (MI) - When we remove an instruction from a basic block @@ -122,8 +120,6 @@ void ilist_traits::removeNodeFromList(MachineInstr *N) { N->RemoveRegOperandsFromUseLists(MF->getRegInfo()); N->setParent(nullptr); - - LeakDetector::addGarbageObject(N); } /// transferNodesFromList (MI) - When moving a range of instructions from one -- cgit v1.2.3