From: Daniel Dunbar Date: Wed, 8 Sep 2010 18:19:55 +0000 (+0000) Subject: Frontend/-H: Add comment on why I used a temporary string here. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4566d1a0e5750dc21bd9120be3e1a98d60db5620;p=clang Frontend/-H: Add comment on why I used a temporary string here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113379 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/PrintPreprocessedOutput.cpp b/lib/Frontend/PrintPreprocessedOutput.cpp index cfaf8a23b1..5ae02f97bd 100644 --- a/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/lib/Frontend/PrintPreprocessedOutput.cpp @@ -263,6 +263,7 @@ void PrintPPOutputPPCallbacks::FileChanged(SourceLocation Loc, // predefines buffer. if (DumpHeaderIncludes && HasProcessedPredefines && Reason == PPCallbacks::EnterFile) { + // Write to a temporary string to avoid unnecessary flushing on errs(). llvm::SmallString<256> Msg; llvm::raw_svector_ostream OS(Msg); for (unsigned i = 0; i != CurrentIncludeDepth; ++i)