From 04ebde017f768c87895209e0dee9074ed145a0f3 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 8 Sep 2010 18:19:55 +0000 Subject: [PATCH] Frontend/-H: Add comment on why I used a temporary string here. llvm-svn: 113379 --- clang/lib/Frontend/PrintPreprocessedOutput.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp index cfaf8a23b118..5ae02f97bd4b 100644 --- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/clang/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)