diff options
author | Alp Toker <alp@nuanti.com> | 2014-06-26 22:52:05 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-06-26 22:52:05 +0000 |
commit | e69170a11079504e1b20ec79296925f295dc01c0 (patch) | |
tree | 7c415eb6c14f0afb0e97e42d6ba2579dd897fb3a /llvm/tools/llvm-objdump/llvm-objdump.cpp | |
parent | 11c6f6165b76a42da7eaf4514e419be397d7fc44 (diff) | |
download | bcm5719-llvm-e69170a11079504e1b20ec79296925f295dc01c0.tar.gz bcm5719-llvm-e69170a11079504e1b20ec79296925f295dc01c0.zip |
Revert "Introduce a string_ostream string builder facilty"
Temporarily back out commits r211749, r211752 and r211754.
llvm-svn: 211814
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r-- | llvm/tools/llvm-objdump/llvm-objdump.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index d9886c10aeb..d98691b4b04 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -222,7 +222,8 @@ static void emitDOTFile(const char *FileName, const MCFunction &f, Out << "<o>"; // Escape special chars and print the instruction in mnemonic form. - string_ostream OS; + std::string Str; + raw_string_ostream OS(Str); IP->printInst(&(*i)->getInsts()->at(ii).Inst, OS, ""); Out << DOT::EscapeString(OS.str()); } @@ -472,7 +473,9 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { if (Symbols.empty()) Symbols.push_back(std::make_pair(0, name)); - small_string_ostream<40> Comments; + + SmallString<40> Comments; + raw_svector_ostream CommentStream(Comments); StringRef Bytes; if (error(Section.getContents(Bytes))) @@ -510,14 +513,15 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { MCInst Inst; if (DisAsm->getInstruction(Inst, Size, memoryObject, - SectionAddr + Index, DebugOut, Comments)) { + SectionAddr + Index, + DebugOut, CommentStream)) { outs() << format("%8" PRIx64 ":", SectionAddr + Index); if (!NoShowRawInsn) { outs() << "\t"; DumpBytes(StringRef(Bytes.data() + Index, Size)); } IP->printInst(&Inst, outs(), ""); - outs() << Comments.str(); + outs() << CommentStream.str(); Comments.clear(); outs() << "\n"; } else { |