From: Jeffrey Yasskin Date: Mon, 22 Mar 2010 15:56:04 +0000 (+0000) Subject: Avoid leaking the FunctionPassManager from opt. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bd85e8e3adc1637d0e301c78953a8bfa208bdcd7;p=oota-llvm.git Avoid leaking the FunctionPassManager from opt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99180 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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)); }