diff options
author | Bill Wendling <isanbard@gmail.com> | 2006-11-29 00:19:40 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2006-11-29 00:19:40 +0000 |
commit | 68fe61d6a165ea6090008e281330895a21607daf (patch) | |
tree | 2e0cc1cbd16099aed908dbb3ecda16cf57d04300 /tools/lto/lto.cpp | |
parent | a5b31ca85686062408bca0f0a8aa43f9fe58e644 (diff) | |
download | external_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/lto/lto.cpp')
-rw-r--r-- | tools/lto/lto.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp index 6a76772..65fcef6 100644 --- a/tools/lto/lto.cpp +++ b/tools/lto/lto.cpp @@ -37,10 +37,10 @@ #include "llvm/Transforms/Scalar.h" #include "llvm/Analysis/LoadValueNumbering.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/Streams.h" #include "llvm/LinkTimeOptimizer.h" #include <fstream> -#include <iostream> - +#include <ostream> using namespace llvm; extern "C" @@ -361,7 +361,8 @@ LTO::optimizeModules(const std::string &OutputFilename, std::string tempFileName(FinalOutputPath.c_str()); tempFileName += "0.bc"; std::ofstream Out(tempFileName.c_str(), io_mode); - WriteBytecodeToFile(bigOne, Out, true); + llvm_ostream L(Out); + WriteBytecodeToFile(bigOne, L, true); } // Strip leading underscore because it was added to match names @@ -377,17 +378,17 @@ LTO::optimizeModules(const std::string &OutputFilename, std::string ErrMsg; sys::Path TempDir = sys::Path::GetTemporaryDirectory(&ErrMsg); if (TempDir.isEmpty()) { - std::cerr << "lto: " << ErrMsg << "\n"; + llvm_cerr << "lto: " << ErrMsg << "\n"; return LTO_WRITE_FAILURE; } sys::Path tmpAsmFilePath(TempDir); if (!tmpAsmFilePath.appendComponent("lto")) { - std::cerr << "lto: " << ErrMsg << "\n"; + llvm_cerr << "lto: " << ErrMsg << "\n"; TempDir.eraseFromDisk(true); return LTO_WRITE_FAILURE; } if (tmpAsmFilePath.createTemporaryFileOnDisk(&ErrMsg)) { - std::cerr << "lto: " << ErrMsg << "\n"; + llvm_cerr << "lto: " << ErrMsg << "\n"; TempDir.eraseFromDisk(true); return LTO_WRITE_FAILURE; } @@ -414,7 +415,8 @@ LTO::optimizeModules(const std::string &OutputFilename, std::string tempFileName(FinalOutputPath.c_str()); tempFileName += "1.bc"; std::ofstream Out(tempFileName.c_str(), io_mode); - WriteBytecodeToFile(bigOne, Out, true); + llvm_ostream L(Out); + WriteBytecodeToFile(bigOne, L, true); } targetTriple = bigOne->getTargetTriple(); @@ -443,7 +445,7 @@ LTO::optimizeModules(const std::string &OutputFilename, args.push_back(0); if (sys::Program::ExecuteAndWait(gcc, &args[0], 0, 0, 1, &ErrMsg)) { - std::cerr << "lto: " << ErrMsg << "\n"; + llvm_cerr << "lto: " << ErrMsg << "\n"; return LTO_ASM_FAILURE; } |