]> granicus.if.org Git - clang/commitdiff
Be sure to flush raw_string_ostream objects in the Objective-C
authorDouglas Gregor <dgregor@apple.com>
Wed, 20 Apr 2011 13:35:54 +0000 (13:35 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 20 Apr 2011 13:35:54 +0000 (13:35 +0000)
rewriter, from Eric Niebler!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129849 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Rewrite/Rewriter.cpp

index 2ff61363ffbd7d3e2f5c9412c801383c6b3cba41..10ed38b86b7afc12cc6e873a3030502d5147625e 100644 (file)
@@ -300,6 +300,7 @@ bool Rewriter::ReplaceStmt(Stmt *From, Stmt *To) {
   std::string SStr;
   llvm::raw_string_ostream S(SStr);
   To->printPretty(S, 0, PrintingPolicy(*LangOpts));
+  S.flush();
   const std::string &Str = S.str();
 
   ReplaceText(From->getLocStart(), Size, Str);
@@ -310,6 +311,7 @@ std::string Rewriter::ConvertToString(Stmt *From) {
   std::string SStr;
   llvm::raw_string_ostream S(SStr);
   From->printPretty(S, 0, PrintingPolicy(*LangOpts));
+  S.flush();
   return SStr;
 }