From 823c4abb58bbe2a502657e068b011d864cc6d896 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 8 Sep 2002 21:19:29 +0000 Subject: [PATCH] Make sure the leakdetector is told about temporary Phi nodes also, so it doesn't erroneously report them as leaks git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3624 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/InstrSelection/InstrSelection.cpp | 7 ++++++- lib/Target/SparcV9/InstrSelection/InstrSelection.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/InstrSelection/InstrSelection.cpp b/lib/CodeGen/InstrSelection/InstrSelection.cpp index a6e5a77d0ea..28bfb74666d 100644 --- a/lib/CodeGen/InstrSelection/InstrSelection.cpp +++ b/lib/CodeGen/InstrSelection/InstrSelection.cpp @@ -173,7 +173,12 @@ InstructionSelection::InsertCodeForPhis(Function &F) PHINode *PN = dyn_cast(&*IIt); ++IIt) { // FIXME: This is probably wrong... Value *PhiCpRes = new PHINode(PN->getType(), "PhiCp:"); - + + // The leak detector shouldn't track these nodes. They are not garbage, + // even though their parent field is never filled in. + // + LeakDetector::removeGarbageObject(PhiCpRes); + // for each incoming value of the phi, insert phi elimination // for (unsigned i = 0; i < PN->getNumIncomingValues(); ++i) { diff --git a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp index a6e5a77d0ea..28bfb74666d 100644 --- a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp +++ b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp @@ -173,7 +173,12 @@ InstructionSelection::InsertCodeForPhis(Function &F) PHINode *PN = dyn_cast(&*IIt); ++IIt) { // FIXME: This is probably wrong... Value *PhiCpRes = new PHINode(PN->getType(), "PhiCp:"); - + + // The leak detector shouldn't track these nodes. They are not garbage, + // even though their parent field is never filled in. + // + LeakDetector::removeGarbageObject(PhiCpRes); + // for each incoming value of the phi, insert phi elimination // for (unsigned i = 0; i < PN->getNumIncomingValues(); ++i) {