diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2010-03-22 15:56:04 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2010-03-22 15:56:04 +0000 |
commit | bd85e8e3adc1637d0e301c78953a8bfa208bdcd7 (patch) | |
tree | 7e5647bb39206bd0f30357e3a8391086e3ae200b | |
parent | 1cde4af15712f6ccdb81ab540df800cda90d0d74 (diff) |
Avoid leaking the FunctionPassManager from opt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99180 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | tools/opt/opt.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index b123d54eee..4fb0025504 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<FunctionPassManager> FPasses; if (OptLevelO1 || OptLevelO2 || OptLevelO3) { - FPasses = new FunctionPassManager(M.get()); + FPasses.reset(new FunctionPassManager(M.get())); if (TD) FPasses->add(new TargetData(*TD)); } |