From c4e4a996772279dd1155e1deac141a7a60da1c31 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 8 Sep 2002 19:00:07 +0000 Subject: [PATCH] Enable "garbage detection" of LLVM objects. Check for leaks after running every pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3621 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/PassManagerT.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/VMCore/PassManagerT.h b/lib/VMCore/PassManagerT.h index e88693fbfff..4a2ad886714 100644 --- a/lib/VMCore/PassManagerT.h +++ b/lib/VMCore/PassManagerT.h @@ -17,6 +17,7 @@ #include "llvm/Pass.h" #include "Support/CommandLine.h" +#include "Support/LeakDetector.h" #include #include class Annotable; @@ -217,6 +218,10 @@ public: endPass(P); MadeChanges |= Changed; + // Check for memory leaks by the pass... + LeakDetector::checkForGarbage(std::string("after running pass '") + + P->getPassName() + "'"); + if (Changed) PMDebug::PrintPassInformation(getDepth()+1, "Made Modification", P, (Annotable*)M); -- 2.34.1