Avoid leaking the FunctionPassManager from opt.

llvm-svn: 99180
This commit is contained in:
Jeffrey Yasskin 2010-03-22 15:56:04 +00:00
parent 7bf6b8a416
commit 38da2b015f
1 changed files with 2 additions and 2 deletions

View File

@ -424,9 +424,9 @@ int main(int argc, char **argv) {
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));
}