Revert "Introduce a string_ostream string builder facilty"
[oota-llvm.git] / lib / IRReader / IRReader.cpp
index e72990751b06c622e46871eb7f5de51b05f9dd32..01aa074abad62f33af2a022cf6a938cf58709eb4 100644 (file)
@@ -108,10 +108,13 @@ LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef,
 
   if(!*OutM) {
     if (OutMessage) {
-      string_ostream os;
+      std::string buf;
+      raw_string_ostream os(buf);
+
       Diag.print(nullptr, os, false);
-      os << '\0';
-      *OutMessage = strdup(os.str().data());
+      os.flush();
+
+      *OutMessage = strdup(buf.c_str());
     }
     return 1;
   }