From dded107d64022075e7dcd54ea952bbda41fb8b2e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 17 Aug 2002 22:40:03 +0000 Subject: [PATCH] Do not leak memory for passes when using -stopAfterNPasses or -stopraise llvm-svn: 3371 --- llvm/tools/gccas/gccas.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/tools/gccas/gccas.cpp b/llvm/tools/gccas/gccas.cpp index 215f5e9bba64..a5ceace4456a 100644 --- a/llvm/tools/gccas/gccas.cpp +++ b/llvm/tools/gccas/gccas.cpp @@ -58,6 +58,8 @@ static inline void addPass(PassManager &PM, Pass *P) { // Keep track of how many passes we made for -stopAfterNPasses ++NumPassesCreated; + } else { + delete P; // We don't want this pass to run, just delete it now } }