summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-06 19:17:23 +0000
committerChris Lattner <sabre@nondot.org>2007-05-06 19:17:23 +0000
commitd44ae90fc8974e01ac672af2816516639ff106ef (patch)
treecf76262ba8c5c1e52508e81247e2be6541a810b0
parent9e66233361694bc495acba6bf0d472c5050b1d37 (diff)
downloadllvm-d44ae90fc8974e01ac672af2816516639ff106ef.tar.gz
make sure the ofstream for opt's output file is destroyed, so that the bits
actually land on disk. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36877 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/opt/opt.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index 99249b9442cf..4ef1a6e39c7f 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -365,6 +365,9 @@ int main(int argc, char **argv) {
// Now that we have all of the passes ready, run them.
Passes.run(*M.get());
+ // Delete the ofstream.
+ if (Out != &std::cout)
+ delete Out;
return 0;
} catch (const std::string& msg) {