From: Fariborz Jahanian Date: Wed, 20 Apr 2011 16:38:37 +0000 (+0000) Subject: Use S.str() to force a flush. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=85b1c7ce94904873b1c0b7d08a6bce885d8eb245;p=clang Use S.str() to force a flush. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129856 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Rewrite/Rewriter.cpp b/lib/Rewrite/Rewriter.cpp index 10ed38b86b..51fe379fee 100644 --- a/lib/Rewrite/Rewriter.cpp +++ b/lib/Rewrite/Rewriter.cpp @@ -300,7 +300,6 @@ 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); @@ -311,8 +310,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; + return S.str(); } bool Rewriter::IncreaseIndentation(CharSourceRange range,