aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-08 21:19:29 +0000
committerChris Lattner <sabre@nondot.org>2002-09-08 21:19:29 +0000
commit823c4abb58bbe2a502657e068b011d864cc6d896 (patch)
tree35847b3e318258b0e73f2a9f3ac2303b5c891299 /lib/CodeGen
parenta175ed419459f9d2e3cee67d43de3ced28b2341d (diff)
downloadexternal_llvm-823c4abb58bbe2a502657e068b011d864cc6d896.zip
external_llvm-823c4abb58bbe2a502657e068b011d864cc6d896.tar.gz
external_llvm-823c4abb58bbe2a502657e068b011d864cc6d896.tar.bz2
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
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/InstrSelection/InstrSelection.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/InstrSelection/InstrSelection.cpp b/lib/CodeGen/InstrSelection/InstrSelection.cpp
index a6e5a77..28bfb74 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<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) {