aboutsummaryrefslogtreecommitdiffstats
path: root/tools/opt/opt.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2006-12-01 00:43:14 +0000
committerNick Lewycky <nicholas@mxc.ca>2006-12-01 00:43:14 +0000
commit5cbc63e91add9c23dbb8224023403bf93ccbd845 (patch)
tree1b003699a050794bddfeeeba0ee79f0e2a38006f /tools/opt/opt.cpp
parent1000b73397bd72b71ede338caf5b6379072d94a4 (diff)
downloadexternal_llvm-5cbc63e91add9c23dbb8224023403bf93ccbd845.zip
external_llvm-5cbc63e91add9c23dbb8224023403bf93ccbd845.tar.gz
external_llvm-5cbc63e91add9c23dbb8224023403bf93ccbd845.tar.bz2
Fix opt -o option. Don't pass a pointer to an auto variable which is going
away before it's needed, and don't try to delete that pointer! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32055 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt/opt.cpp')
-rw-r--r--tools/opt/opt.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index e43b76f..c552d69 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -252,10 +252,9 @@ int main(int argc, char **argv) {
Passes.add(createVerifierPass());
// Write bytecode out to disk or cout as the last step...
- if (!NoOutput && !AnalyzeOnly) {
- llvm_ostream L(*Out);
- Passes.add(new WriteBytecodePass(&L, Out != &std::cout, !NoCompress));
- }
+ llvm_ostream L(*Out);
+ if (!NoOutput && !AnalyzeOnly)
+ Passes.add(new WriteBytecodePass(&L, false, !NoCompress));
// Now that we have all of the passes ready, run them.
Passes.run(*M.get());