Avoid leaking the FunctionPassManager from opt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99180 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jeffrey Yasskin 2010-03-22 15:56:04 +00:00
parent 1cde4af157
commit bd85e8e3ad

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));
}