forked from OSchip/llvm-project
Avoid leaking the FunctionPassManager from opt.
llvm-svn: 99180
This commit is contained in:
parent
7bf6b8a416
commit
38da2b015f
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue