Remove some std stream usage from Support and TableGen
LLVM's coding standards recommend raw_ostream and MemoryBuffer for
reading and writing text.
This has the side effect of allowing clang to compile more of Support
and TableGen in the Microsoft C++ ABI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187826 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Support/Disassembler.cpp b/lib/Support/Disassembler.cpp
index b3244fa..27df3a9 100644
--- a/lib/Support/Disassembler.cpp
+++ b/lib/Support/Disassembler.cpp
@@ -41,10 +41,10 @@
std::string llvm::sys::disassembleBuffer(uint8_t* start, size_t length,
uint64_t pc) {
- std::stringstream res;
-
#if (defined (__i386__) || defined (__amd64__) || defined (__x86_64__)) \
&& USE_UDIS86
+ std::stringstream res;
+
unsigned bits;
# if defined(__i386__)
bits = 32;
@@ -66,9 +66,9 @@
while (ud_disassemble(&ud_obj)) {
res << ud_insn_off(&ud_obj) << ":\t" << ud_insn_asm(&ud_obj) << "\n";
}
-#else
- res << "No disassembler available. See configure help for options.\n";
-#endif
return res.str();
+#else
+ return "No disassembler available. See configure help for options.\n";
+#endif
}