aboutsummaryrefslogtreecommitdiffstats
path: root/tools/opt/opt.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2006-11-29 00:19:40 +0000
committerBill Wendling <isanbard@gmail.com>2006-11-29 00:19:40 +0000
commit68fe61d6a165ea6090008e281330895a21607daf (patch)
tree2e0cc1cbd16099aed908dbb3ecda16cf57d04300 /tools/opt/opt.cpp
parenta5b31ca85686062408bca0f0a8aa43f9fe58e644 (diff)
downloadexternal_llvm-68fe61d6a165ea6090008e281330895a21607daf.zip
external_llvm-68fe61d6a165ea6090008e281330895a21607daf.tar.gz
external_llvm-68fe61d6a165ea6090008e281330895a21607daf.tar.bz2
Replacing std::iostreams with llvm iostreams. Some of these changes involve
adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31990 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt/opt.cpp')
-rw-r--r--tools/opt/opt.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index 502118e..e43b76f 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -28,6 +28,7 @@
#include "llvm/Support/Timer.h"
#include "llvm/LinkAllPasses.h"
#include "llvm/LinkAllVMCore.h"
+#include <iostream>
#include <fstream>
#include <memory>
#include <algorithm>
@@ -251,8 +252,10 @@ int main(int argc, char **argv) {
Passes.add(createVerifierPass());
// Write bytecode out to disk or cout as the last step...
- if (!NoOutput && !AnalyzeOnly)
- Passes.add(new WriteBytecodePass(Out, Out != &std::cout, !NoCompress));
+ if (!NoOutput && !AnalyzeOnly) {
+ llvm_ostream L(*Out);
+ Passes.add(new WriteBytecodePass(&L, Out != &std::cout, !NoCompress));
+ }
// Now that we have all of the passes ready, run them.
Passes.run(*M.get());