Make sure the leakdetector is told about temporary Phi nodes also, so it doesn't

erroneously report them as leaks

llvm-svn: 3624
This commit is contained in:
Chris Lattner 2002-09-08 21:19:29 +00:00
parent 16d4c60600
commit 74946507fc
1 changed files with 6 additions and 1 deletions

View File

@ -173,7 +173,12 @@ InstructionSelection::InsertCodeForPhis(Function &F)
PHINode *PN = dyn_cast<PHINode>(&*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) {