Enable "garbage detection" of LLVM objects. Check for leaks after running
authorChris Lattner <sabre@nondot.org>
Sun, 8 Sep 2002 19:00:07 +0000 (19:00 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 8 Sep 2002 19:00:07 +0000 (19:00 +0000)
every pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3621 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/PassManagerT.h

index e88693fbfff23cda8d266364da38fae4c7169e5f..4a2ad8867146d875df239874481e2f44dfea4fda 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "llvm/Pass.h"
 #include "Support/CommandLine.h"
+#include "Support/LeakDetector.h"
 #include <algorithm>
 #include <iostream>
 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);