diff options
author | David Greene <greened@obbligato.org> | 2009-07-14 20:18:05 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2009-07-14 20:18:05 +0000 |
commit | 71847813bc419f7a0667468136a07429c6d9f164 (patch) | |
tree | 6cd09f8ff7f7b28b32c364fb6f63f44e85937880 /tools/lto | |
parent | a266b5f22811480a65e65a08c8a5d92fe9be8a3b (diff) |
Have asm printers use formatted_raw_ostream directly to avoid a
dynamic_cast<>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75670 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto')
-rw-r--r-- | tools/lto/LTOCodeGenerator.cpp | 8 | ||||
-rw-r--r-- | tools/lto/LTOCodeGenerator.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp index 26effa5527..b4c4e7767b 100644 --- a/tools/lto/LTOCodeGenerator.cpp +++ b/tools/lto/LTOCodeGenerator.cpp @@ -30,11 +30,11 @@ #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/CodeGen/FileWriters.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/FormattedStream.h" #include "llvm/Support/Mangler.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/StandardPasses.h" #include "llvm/Support/SystemUtils.h" -#include "llvm/Support/raw_ostream.h" #include "llvm/System/Signals.h" #include "llvm/Target/SubtargetFeature.h" #include "llvm/Target/TargetOptions.h" @@ -185,7 +185,9 @@ const void* LTOCodeGenerator::compile(size_t* length, std::string& errMsg) // generate assembly code bool genResult = false; { - raw_fd_ostream asmFile(uniqueAsmPath.c_str(), false, errMsg); + raw_fd_ostream asmFD(raw_fd_ostream(uniqueAsmPath.c_str(), + false, errMsg)); + formatted_raw_ostream asmFile(asmFD); if (!errMsg.empty()) return NULL; genResult = this->generateAssemblyCode(asmFile, errMsg); @@ -390,7 +392,7 @@ void LTOCodeGenerator::applyScopeRestrictions() } /// Optimize merged modules using various IPO passes -bool LTOCodeGenerator::generateAssemblyCode(raw_ostream& out, +bool LTOCodeGenerator::generateAssemblyCode(formatted_raw_ostream& out, std::string& errMsg) { if ( this->determineTarget(errMsg) ) diff --git a/tools/lto/LTOCodeGenerator.h b/tools/lto/LTOCodeGenerator.h index 5548050fda..ef76364212 100644 --- a/tools/lto/LTOCodeGenerator.h +++ b/tools/lto/LTOCodeGenerator.h @@ -45,7 +45,7 @@ public: const void* compile(size_t* length, std::string& errMsg); void setCodeGenDebugOptions(const char *opts); private: - bool generateAssemblyCode(llvm::raw_ostream& out, + bool generateAssemblyCode(llvm::formatted_raw_ostream& out, std::string& errMsg); bool assemble(const std::string& asmPath, const std::string& objPath, std::string& errMsg); |