From: Chris Lattner Date: Sat, 17 Aug 2002 22:40:03 +0000 (+0000) Subject: Do not leak memory for passes when using -stopAfterNPasses or -stopraise X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=374a0950cc936b746f40693a1ca1a607f7bbc56e;p=oota-llvm.git Do not leak memory for passes when using -stopAfterNPasses or -stopraise git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3371 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/gccas/gccas.cpp b/tools/gccas/gccas.cpp index 215f5e9bba6..a5ceace4456 100644 --- a/tools/gccas/gccas.cpp +++ b/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 } }