summaryrefslogtreecommitdiff
path: root/tools/llvm-objdump
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-06-26 22:52:05 +0000
committerAlp Toker <alp@nuanti.com>2014-06-26 22:52:05 +0000
commit8dd8d5c2b2ad0f9dd1ca01c0a7d8ebac57b8537d (patch)
tree7da91c52380a71a92a895b0c172ae28b83fb6011 /tools/llvm-objdump
parenteca517deaa890b1658ed0452704f398ce80e47b8 (diff)
downloadllvm-8dd8d5c2b2ad0f9dd1ca01c0a7d8ebac57b8537d.tar.gz
llvm-8dd8d5c2b2ad0f9dd1ca01c0a7d8ebac57b8537d.tar.bz2
llvm-8dd8d5c2b2ad0f9dd1ca01c0a7d8ebac57b8537d.tar.xz
Revert "Introduce a string_ostream string builder facilty"
Temporarily back out commits r211749, r211752 and r211754. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211814 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-objdump')
-rw-r--r--tools/llvm-objdump/llvm-objdump.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp
index d9886c10ae..d98691b4b0 100644
--- a/tools/llvm-objdump/llvm-objdump.cpp
+++ b/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 {