From: Duncan P. N. Exon Smith Date: Thu, 11 Dec 2014 21:51:37 +0000 (+0000) Subject: CodeGen: Stop using LeakDetector for MachineInstr X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f88e4c8e9171045454b2c8e05054c2af8da3fe4f;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224061 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index 36ae30940fa..a7dc1b328c1 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/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