From bd85e8e3adc1637d0e301c78953a8bfa208bdcd7 Mon Sep 17 00:00:00 2001 From: Jeffrey Yasskin Date: Mon, 22 Mar 2010 15:56:04 +0000 Subject: [PATCH] Avoid leaking the FunctionPassManager from opt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99180 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/opt/opt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index b123d54eeea..4fb00255041 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -424,9 +424,9 @@ int main(int argc, char **argv) { if (TD) Passes.add(TD); - FunctionPassManager *FPasses = NULL; + OwningPtr FPasses; if (OptLevelO1 || OptLevelO2 || OptLevelO3) { - FPasses = new FunctionPassManager(M.get()); + FPasses.reset(new FunctionPassManager(M.get())); if (TD) FPasses->add(new TargetData(*TD)); } -- 2.34.1