[llvm-commits] [llvm] r99180 - /llvm/trunk/tools/opt/opt.cpp
Jeffrey Yasskin
jyasskin at google.com
Mon Mar 22 08:56:04 PDT 2010
Author: jyasskin
Date: Mon Mar 22 10:56:04 2010
New Revision: 99180
URL: http://llvm.org/viewvc/llvm-project?rev=99180&view=rev
Log:
Avoid leaking the FunctionPassManager from opt.
Modified:
llvm/trunk/tools/opt/opt.cpp
Modified: llvm/trunk/tools/opt/opt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=99180&r1=99179&r2=99180&view=diff
==============================================================================
--- llvm/trunk/tools/opt/opt.cpp (original)
+++ llvm/trunk/tools/opt/opt.cpp Mon Mar 22 10:56:04 2010
@@ -424,9 +424,9 @@
if (TD)
Passes.add(TD);
- FunctionPassManager *FPasses = NULL;
+ OwningPtr<FunctionPassManager> FPasses;
if (OptLevelO1 || OptLevelO2 || OptLevelO3) {
- FPasses = new FunctionPassManager(M.get());
+ FPasses.reset(new FunctionPassManager(M.get()));
if (TD)
FPasses->add(new TargetData(*TD));
}
More information about the llvm-commits
mailing list