Index: lib/Rewrite/Rewriter.cpp
===================================================================
--- lib/Rewrite/Rewriter.cpp	(revision 129845)
+++ lib/Rewrite/Rewriter.cpp	(working copy)
@@ -300,6 +300,7 @@
   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 SStr;
   llvm::raw_string_ostream S(SStr);
   From->printPretty(S, 0, PrintingPolicy(*LangOpts));
+  S.flush();
   return SStr;
 }
 
