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 | 8dd8d5c2b2ad0f9dd1ca01c0a7d8ebac57b8537d (patch) | |
tree | 7da91c52380a71a92a895b0c172ae28b83fb6011 /lib/LTO | |
parent | eca517deaa890b1658ed0452704f398ce80e47b8 (diff) | |
download | llvm-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 'lib/LTO')
-rw-r--r-- | lib/LTO/LTOCodeGenerator.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/LTO/LTOCodeGenerator.cpp b/lib/LTO/LTOCodeGenerator.cpp index d87299b5c7..a1709f60ff 100644 --- a/lib/LTO/LTOCodeGenerator.cpp +++ b/lib/LTO/LTOCodeGenerator.cpp @@ -549,17 +549,16 @@ void LTOCodeGenerator::DiagnosticHandler2(const DiagnosticInfo &DI) { break; } // Create the string that will be reported to the external diagnostic handler. - string_ostream Msg; - DiagnosticPrinterRawOStream DP(Msg); + std::string MsgStorage; + raw_string_ostream Stream(MsgStorage); + DiagnosticPrinterRawOStream DP(Stream); DI.print(DP); - - // Null-terminate the C string. - Msg << '\0'; + Stream.flush(); // If this method has been called it means someone has set up an external // diagnostic handler. Assert on that. assert(DiagHandler && "Invalid diagnostic handler"); - (*DiagHandler)(Severity, Msg.str().data(), DiagContext); + (*DiagHandler)(Severity, MsgStorage.c_str(), DiagContext); } void |