diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index 90cd07a6ec521f915bc6e0b70a320c90b807d130..69144735c9721892f5c4186e951a39e7025305f7 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/lib/AST/DeclPrinter.cpp @@ -19,7 +19,6 @@ #include "clang/AST/Expr.h" #include "clang/AST/PrettyPrinter.h" #include "llvm/Support/Compiler.h" -#include "llvm/Support/Streams.h" #include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" using namespace clang; diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 36464ca3961b3191ec58a86717f1d00a0c606b4a..1c3041c8cdb6685ab93c9f2881934f99b1f430f0 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -17,7 +17,6 @@ #include "clang/AST/DeclObjC.h" #include "clang/AST/PrettyPrinter.h" #include "llvm/Support/Compiler.h" -#include "llvm/Support/Streams.h" #include "llvm/Support/Format.h" using namespace clang; diff --git a/lib/Analysis/AnalysisManager.cpp b/lib/Analysis/AnalysisManager.cpp index f29cd7857595e919634294f38473716d6c48011b..1b490a327ae8ebbddbd92b9e27c17c820512cd44 100644 --- a/lib/Analysis/AnalysisManager.cpp +++ b/lib/Analysis/AnalysisManager.cpp @@ -13,7 +13,6 @@ #include "clang/Analysis/PathSensitive/AnalysisManager.h" #include "clang/Basic/SourceManager.h" -#include "llvm/Support/Streams.h" using namespace clang; @@ -29,8 +28,8 @@ void AnalysisManager::DisplayFunction() { isa<ObjCMethodDecl>(getCodeDecl())) { const NamedDecl *ND = cast<NamedDecl>(getCodeDecl()); SourceManager &SM = getContext().getSourceManager(); - llvm::cerr << "ANALYZE: " - << SM.getPresumedLoc(ND->getLocation()).getFilename() - << ' ' << ND->getNameAsString() << '\n'; + llvm::errs() << "ANALYZE: " + << SM.getPresumedLoc(ND->getLocation()).getFilename() + << ' ' << ND->getNameAsString() << '\n'; } } diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp index 50b90f5813a7ab80f4b5ddabd381e995a0e55669..cb2af0f537cc8e1268bd9a78caa94a6a62e1d12c 100644 --- a/lib/Analysis/BasicStore.cpp +++ b/lib/Analysis/BasicStore.cpp @@ -15,9 +15,8 @@ #include "clang/Analysis/Analyses/LiveVariables.h" #include "clang/Analysis/PathSensitive/AnalysisContext.h" #include "clang/Analysis/PathSensitive/GRState.h" -#include "llvm/ADT/ImmutableMap.h" #include "llvm/Support/Compiler.h" -#include "llvm/Support/Streams.h" +#include "llvm/ADT/ImmutableMap.h" using namespace clang; diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index 1cfe858c8dbcc6a36980e471b8fcd9909e500342..08a13c4d8ed3f4cdc420e64ef6a2f719f23a5d64 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -16,13 +16,12 @@ #include "clang/Analysis/CFG.h" #include "clang/AST/StmtVisitor.h" #include "clang/AST/PrettyPrinter.h" -#include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/SmallPtrSet.h" #include "llvm/Support/GraphWriter.h" -#include "llvm/Support/Streams.h" #include "llvm/Support/Compiler.h" -#include <llvm/Support/Allocator.h> -#include <llvm/Support/Format.h> +#include "llvm/Support/Allocator.h" +#include "llvm/Support/Format.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/SmallPtrSet.h" using namespace clang; diff --git a/lib/Analysis/Environment.cpp b/lib/Analysis/Environment.cpp index 3f8f14dcb0b4ee31a8b66a3572c81a8221e88453..9d8e09c7041aac2a40f13ac614db1c5380e2d3c3 100644 --- a/lib/Analysis/Environment.cpp +++ b/lib/Analysis/Environment.cpp @@ -12,9 +12,8 @@ //===----------------------------------------------------------------------===// #include "clang/Analysis/PathSensitive/GRState.h" #include "clang/Analysis/Analyses/LiveVariables.h" -#include "llvm/ADT/ImmutableMap.h" -#include "llvm/Support/Streams.h" #include "llvm/Support/Compiler.h" +#include "llvm/ADT/ImmutableMap.h" using namespace clang; diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index f4711a15203c5e1e7d4ab96a43fd8f45403d90d8..ace75cb943f209bde2f5901598e077d6530933b8 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -22,10 +22,9 @@ #include "clang/Basic/SourceManager.h" #include "clang/Basic/SourceManager.h" #include "clang/Basic/PrettyStackTrace.h" -#include "llvm/Support/Streams.h" -#include "llvm/ADT/ImmutableList.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/ADT/ImmutableList.h" #ifndef NDEBUG #include "llvm/Support/GraphWriter.h" @@ -3292,7 +3291,7 @@ void GRExprEngine::ViewGraph(ExplodedNode** Beg, ExplodedNode** End) { std::auto_ptr<ExplodedGraph> TrimmedG(G.Trim(Beg, End).first); if (!TrimmedG.get()) - llvm::cerr << "warning: Trimmed ExplodedGraph is empty.\n"; + llvm::errs() << "warning: Trimmed ExplodedGraph is empty.\n"; else llvm::ViewGraph(*TrimmedG->roots_begin(), "TrimmedGRExprEngine"); diff --git a/lib/Analysis/SVals.cpp b/lib/Analysis/SVals.cpp index c597ba459e76af6155ebbdc1398c991460704db8..b2f2e966444e5f96a9069a8d0cb3d6ac94b5b446 100644 --- a/lib/Analysis/SVals.cpp +++ b/lib/Analysis/SVals.cpp @@ -14,7 +14,6 @@ #include "clang/Analysis/PathSensitive/GRState.h" #include "clang/Basic/IdentifierTable.h" -#include "llvm/Support/Streams.h" using namespace clang; using llvm::dyn_cast; diff --git a/lib/Basic/FileManager.cpp b/lib/Basic/FileManager.cpp index 98979d56cf0da75ee74b223923195e31ae41cd78..4484a0d23e0fe09cd07ba90e35f3317951f918df 100644 --- a/lib/Basic/FileManager.cpp +++ b/lib/Basic/FileManager.cpp @@ -20,7 +20,6 @@ #include "clang/Basic/FileManager.h" #include "llvm/ADT/SmallString.h" #include "llvm/System/Path.h" -#include "llvm/Support/Streams.h" #include "llvm/Config/config.h" using namespace clang; @@ -247,14 +246,14 @@ const FileEntry *FileManager::getFile(const char *NameStart, // Nope, there isn't. Check to see if the file exists. struct stat StatBuf; - //llvm::cerr << "STATING: " << Filename; + //llvm::errs() << "STATING: " << Filename; if (stat_cached(InterndFileName, &StatBuf) || // Error stat'ing. S_ISDIR(StatBuf.st_mode)) { // A directory? // If this file doesn't exist, we leave a null in FileEntries for this path. - //llvm::cerr << ": Not existing\n"; + //llvm::errs() << ": Not existing\n"; return 0; } - //llvm::cerr << ": exists\n"; + //llvm::errs() << ": exists\n"; // It exists. See if we have already opened a file with the same inode. // This occurs when one dir is symlinked to another, for example. @@ -276,15 +275,15 @@ const FileEntry *FileManager::getFile(const char *NameStart, } void FileManager::PrintStats() const { - llvm::cerr << "\n*** File Manager Stats:\n"; - llvm::cerr << UniqueFiles.size() << " files found, " - << UniqueDirs.size() << " dirs found.\n"; - llvm::cerr << NumDirLookups << " dir lookups, " - << NumDirCacheMisses << " dir cache misses.\n"; - llvm::cerr << NumFileLookups << " file lookups, " - << NumFileCacheMisses << " file cache misses.\n"; + llvm::errs() << "\n*** File Manager Stats:\n"; + llvm::errs() << UniqueFiles.size() << " files found, " + << UniqueDirs.size() << " dirs found.\n"; + llvm::errs() << NumDirLookups << " dir lookups, " + << NumDirCacheMisses << " dir cache misses.\n"; + llvm::errs() << NumFileLookups << " file lookups, " + << NumFileCacheMisses << " file cache misses.\n"; - //llvm::cerr << PagesMapped << BytesOfPagesMapped << FSLookups; + //llvm::errs() << PagesMapped << BytesOfPagesMapped << FSLookups; } int MemorizeStatCalls::stat(const char *path, struct stat *buf) { diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index 6640c61ff3b797efecad03a8d95af822fa684ce8..88da73f797f8088b1583ae94676665541dcad529 100644 --- a/lib/Basic/SourceManager.cpp +++ b/lib/Basic/SourceManager.cpp @@ -17,9 +17,7 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/System/Path.h" -#include "llvm/Support/Streams.h" #include <algorithm> -#include <iostream> using namespace clang; using namespace SrcMgr; using llvm::MemoryBuffer; @@ -1062,11 +1060,11 @@ bool SourceManager::isBeforeInTranslationUnit(SourceLocation LHS, /// PrintStats - Print statistics to stderr. /// void SourceManager::PrintStats() const { - llvm::cerr << "\n*** Source Manager Stats:\n"; - llvm::cerr << FileInfos.size() << " files mapped, " << MemBufferInfos.size() - << " mem buffers mapped.\n"; - llvm::cerr << SLocEntryTable.size() << " SLocEntry's allocated, " - << NextOffset << "B of Sloc address space used.\n"; + llvm::errs() << "\n*** Source Manager Stats:\n"; + llvm::errs() << FileInfos.size() << " files mapped, " << MemBufferInfos.size() + << " mem buffers mapped.\n"; + llvm::errs() << SLocEntryTable.size() << " SLocEntry's allocated, " + << NextOffset << "B of Sloc address space used.\n"; unsigned NumLineNumsComputed = 0; unsigned NumFileBytesMapped = 0; @@ -1075,10 +1073,10 @@ void SourceManager::PrintStats() const { NumFileBytesMapped += I->second->getSizeBytesMapped(); } - llvm::cerr << NumFileBytesMapped << " bytes of files mapped, " - << NumLineNumsComputed << " files with line #'s computed.\n"; - llvm::cerr << "FileID scans: " << NumLinearScans << " linear, " - << NumBinaryProbes << " binary.\n"; + llvm::errs() << NumFileBytesMapped << " bytes of files mapped, " + << NumLineNumsComputed << " files with line #'s computed.\n"; + llvm::errs() << "FileID scans: " << NumLinearScans << " linear, " + << NumBinaryProbes << " binary.\n"; } ExternalSLocEntrySource::~ExternalSLocEntrySource() { } diff --git a/lib/Frontend/ASTConsumers.cpp b/lib/Frontend/ASTConsumers.cpp index 8f0ad13319eb2dc4df7623730ff6388881896016..026848bcd5ac5f7cba122e19dcf6c2547823a240 100644 --- a/lib/Frontend/ASTConsumers.cpp +++ b/lib/Frontend/ASTConsumers.cpp @@ -23,7 +23,6 @@ #include "clang/AST/PrettyPrinter.h" #include "clang/CodeGen/ModuleBuilder.h" #include "llvm/Module.h" -#include "llvm/Support/Streams.h" #include "llvm/Support/Timer.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/Path.h" @@ -117,9 +116,9 @@ void ASTViewer::HandleTopLevelSingleDecl(Decl *D) { FD->print(llvm::errs()); if (FD->getBodyIfAvailable()) { - llvm::cerr << '\n'; + llvm::errs() << '\n'; FD->getBodyIfAvailable()->viewAST(); - llvm::cerr << '\n'; + llvm::errs() << '\n'; } return; } @@ -128,9 +127,9 @@ void ASTViewer::HandleTopLevelSingleDecl(Decl *D) { MD->print(llvm::errs()); if (MD->getBody()) { - llvm::cerr << '\n'; + llvm::errs() << '\n'; MD->getBody()->viewAST(); - llvm::cerr << '\n'; + llvm::errs() << '\n'; } } } diff --git a/lib/Frontend/AnalysisConsumer.cpp b/lib/Frontend/AnalysisConsumer.cpp index 9e6bf0b1a8e4364298ccf62c9cbf57c864e46766..33097c6f28bd56b6fccd17a2543307e318d2ab38 100644 --- a/lib/Frontend/AnalysisConsumer.cpp +++ b/lib/Frontend/AnalysisConsumer.cpp @@ -17,8 +17,6 @@ #include "clang/AST/ASTConsumer.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclObjC.h" -#include "llvm/Support/Compiler.h" -#include "llvm/ADT/OwningPtr.h" #include "clang/Analysis/CFG.h" #include "clang/Analysis/Analyses/LiveVariables.h" #include "clang/Analysis/PathDiagnostic.h" @@ -32,10 +30,11 @@ #include "clang/Analysis/PathSensitive/GRTransferFuncs.h" #include "clang/Analysis/PathSensitive/GRExprEngine.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/Streams.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/Path.h" #include "llvm/System/Program.h" +#include "llvm/ADT/OwningPtr.h" using namespace clang; @@ -476,7 +475,7 @@ static ExplodedNode::Auditor* CreateUbiViz() { if (!ErrMsg.empty()) return 0; - llvm::cerr << "Writing '" << Filename << "'.\n"; + llvm::errs() << "Writing '" << Filename << "'.\n"; llvm::OwningPtr<llvm::raw_fd_ostream> Stream; std::string filename = Filename.toString(); @@ -534,7 +533,7 @@ UbigraphViz::UbigraphViz(llvm::raw_ostream* out, llvm::sys::Path& dir, UbigraphViz::~UbigraphViz() { Out.reset(0); - llvm::cerr << "Running 'ubiviz' program... "; + llvm::errs() << "Running 'ubiviz' program... "; std::string ErrMsg; llvm::sys::Path Ubiviz = llvm::sys::Program::FindProgramByName("ubiviz"); std::vector<const char*> args; @@ -543,7 +542,7 @@ UbigraphViz::~UbigraphViz() { args.push_back(0); if (llvm::sys::Program::ExecuteAndWait(Ubiviz, &args[0],0,0,0,0,&ErrMsg)) { - llvm::cerr << "Error viewing graph: " << ErrMsg << "\n"; + llvm::errs() << "Error viewing graph: " << ErrMsg << "\n"; } // Delete the directory. diff --git a/lib/Frontend/CacheTokens.cpp b/lib/Frontend/CacheTokens.cpp index 0065828c6de83e5cf98939ec79b13e6f60617fea..1852e7d54c586527b5d9bb4cbb44634914da3134 100644 --- a/lib/Frontend/CacheTokens.cpp +++ b/lib/Frontend/CacheTokens.cpp @@ -20,12 +20,11 @@ #include "clang/Basic/OnDiskHashTable.h" #include "clang/Lex/Lexer.h" #include "clang/Lex/Preprocessor.h" -#include "llvm/ADT/StringMap.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/Path.h" -#include "llvm/Support/Compiler.h" -#include "llvm/Support/Streams.h" +#include "llvm/ADT/StringMap.h" // FIXME: put this somewhere else? #ifndef S_ISDIR diff --git a/lib/Frontend/FixItRewriter.cpp b/lib/Frontend/FixItRewriter.cpp index 317693323f999fd2305acca2578a7574d30246d5..1499fa94911c438c397d4b4bbd8315fe8f712b97 100644 --- a/lib/Frontend/FixItRewriter.cpp +++ b/lib/Frontend/FixItRewriter.cpp @@ -16,10 +16,9 @@ #include "clang/Frontend/FixItRewriter.h" #include "clang/Basic/SourceManager.h" #include "clang/Frontend/FrontendDiagnostic.h" -#include "llvm/ADT/OwningPtr.h" -#include "llvm/Support/Streams.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/Path.h" +#include "llvm/ADT/OwningPtr.h" using namespace clang; FixItRewriter::FixItRewriter(Diagnostic &Diags, SourceManager &SourceMgr, diff --git a/lib/Frontend/GeneratePCH.cpp b/lib/Frontend/GeneratePCH.cpp index 3b7715ad283c8a476b5ff856a5be171816930a05..43a3a6cbc0e284013949833ae4a8bb369dcd3893 100644 --- a/lib/Frontend/GeneratePCH.cpp +++ b/lib/Frontend/GeneratePCH.cpp @@ -23,7 +23,6 @@ #include "llvm/System/Path.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/Support/Streams.h" #include <string> using namespace clang; diff --git a/lib/Frontend/HTMLDiagnostics.cpp b/lib/Frontend/HTMLDiagnostics.cpp index d92e0d43538fc14e724b010d0ef2759fcb732c66..838b162b798d826f94fd36eb57f1a2c52402d7ac 100644 --- a/lib/Frontend/HTMLDiagnostics.cpp +++ b/lib/Frontend/HTMLDiagnostics.cpp @@ -23,7 +23,6 @@ #include "clang/Lex/Preprocessor.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/Streams.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/Path.h" #include <fstream> @@ -151,9 +150,9 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) { Directory.createDirectoryOnDisk(true, &ErrorMsg); if (!Directory.isDirectory()) { - llvm::cerr << "warning: could not create directory '" - << Directory.toString() << "'\n" - << "reason: " << ErrorMsg << '\n'; + llvm::errs() << "warning: could not create directory '" + << Directory.toString() << "'\n" + << "reason: " << ErrorMsg << '\n'; noDir = true; @@ -313,7 +312,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) { const RewriteBuffer *Buf = R.getRewriteBufferFor(FID); if (!Buf) { - llvm::cerr << "warning: no diagnostics generated for main file.\n"; + llvm::errs() << "warning: no diagnostics generated for main file.\n"; return; } @@ -333,7 +332,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) { os.open(H.toString().c_str()); if (!os) { - llvm::cerr << "warning: could not create file '" << F.toString() << "'\n"; + llvm::errs() << "warning: could not create file '" << F.toString() << "'\n"; return; } diff --git a/lib/Frontend/RewriteMacros.cpp b/lib/Frontend/RewriteMacros.cpp index 1a477be4b588089a4d64281690284406287493d7..5db2170d63e86c504d4011ac7c7a4fc0fd9ae685 100644 --- a/lib/Frontend/RewriteMacros.cpp +++ b/lib/Frontend/RewriteMacros.cpp @@ -16,7 +16,6 @@ #include "clang/Rewrite/Rewriter.h" #include "clang/Lex/Preprocessor.h" #include "clang/Basic/SourceManager.h" -#include "llvm/Support/Streams.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/Path.h" #include "llvm/ADT/OwningPtr.h" diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp index b3de53671b7de0153c8412cc4e5a2c3286658a9d..4d7bb314ed49c70d6e80cab67f9f36c8e1895319 100644 --- a/lib/Frontend/RewriteObjC.cpp +++ b/lib/Frontend/RewriteObjC.cpp @@ -20,12 +20,11 @@ #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/Diagnostic.h" #include "clang/Lex/Lexer.h" +#include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/raw_ostream.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/OwningPtr.h" -#include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/Streams.h" -#include "llvm/Support/raw_ostream.h" using namespace clang; using llvm::utostr; diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp index 916bdefdf2acaa7ba0580311f932836d78760879..2b91cea5ed1f6a8f5b35eb9145497265ee5e7d97 100644 --- a/lib/Lex/PTHLexer.cpp +++ b/lib/Lex/PTHLexer.cpp @@ -97,7 +97,7 @@ LexNextToken: //===--------------------------------------==// #if 0 SourceManager& SM = PP->getSourceManager(); - llvm::cerr << SM.getFileEntryForID(FileID)->getName() + llvm::errs() << SM.getFileEntryForID(FileID)->getName() << ':' << SM.getLogicalLineNumber(Tok.getLocation()) << ':' << SM.getLogicalColumnNumber(Tok.getLocation()) << '\n'; diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index 9f0c15f59e49c8e1352d4004a6f78914536a46ee..4b1cd63187644526ff9d4bfd26835c42ce102174 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -37,7 +37,7 @@ #include "llvm/ADT/APFloat.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/Streams.h" +#include "llvm/Support/raw_ostream.h" #include <cstdio> using namespace clang; @@ -126,27 +126,27 @@ void Preprocessor::setPTHManager(PTHManager* pm) { } void Preprocessor::DumpToken(const Token &Tok, bool DumpFlags) const { - llvm::cerr << tok::getTokenName(Tok.getKind()) << " '" - << getSpelling(Tok) << "'"; + llvm::errs() << tok::getTokenName(Tok.getKind()) << " '" + << getSpelling(Tok) << "'"; if (!DumpFlags) return; - llvm::cerr << "\t"; + llvm::errs() << "\t"; if (Tok.isAtStartOfLine()) - llvm::cerr << " [StartOfLine]"; + llvm::errs() << " [StartOfLine]"; if (Tok.hasLeadingSpace()) - llvm::cerr << " [LeadingSpace]"; + llvm::errs() << " [LeadingSpace]"; if (Tok.isExpandDisabled()) - llvm::cerr << " [ExpandDisabled]"; + llvm::errs() << " [ExpandDisabled]"; if (Tok.needsCleaning()) { const char *Start = SourceMgr.getCharacterData(Tok.getLocation()); - llvm::cerr << " [UnClean='" << std::string(Start, Start+Tok.getLength()) - << "']"; + llvm::errs() << " [UnClean='" << std::string(Start, Start+Tok.getLength()) + << "']"; } - llvm::cerr << "\tLoc=<"; + llvm::errs() << "\tLoc=<"; DumpLocation(Tok.getLocation()); - llvm::cerr << ">"; + llvm::errs() << ">"; } void Preprocessor::DumpLocation(SourceLocation Loc) const { @@ -154,32 +154,32 @@ void Preprocessor::DumpLocation(SourceLocation Loc) const { } void Preprocessor::DumpMacro(const MacroInfo &MI) const { - llvm::cerr << "MACRO: "; + llvm::errs() << "MACRO: "; for (unsigned i = 0, e = MI.getNumTokens(); i != e; ++i) { DumpToken(MI.getReplacementToken(i)); - llvm::cerr << " "; + llvm::errs() << " "; } - llvm::cerr << "\n"; + llvm::errs() << "\n"; } void Preprocessor::PrintStats() { - llvm::cerr << "\n*** Preprocessor Stats:\n"; - llvm::cerr << NumDirectives << " directives found:\n"; - llvm::cerr << " " << NumDefined << " #define.\n"; - llvm::cerr << " " << NumUndefined << " #undef.\n"; - llvm::cerr << " #include/#include_next/#import:\n"; - llvm::cerr << " " << NumEnteredSourceFiles << " source files entered.\n"; - llvm::cerr << " " << MaxIncludeStackDepth << " max include stack depth\n"; - llvm::cerr << " " << NumIf << " #if/#ifndef/#ifdef.\n"; - llvm::cerr << " " << NumElse << " #else/#elif.\n"; - llvm::cerr << " " << NumEndif << " #endif.\n"; - llvm::cerr << " " << NumPragma << " #pragma.\n"; - llvm::cerr << NumSkipped << " #if/#ifndef#ifdef regions skipped\n"; - - llvm::cerr << NumMacroExpanded << "/" << NumFnMacroExpanded << "/" + llvm::errs() << "\n*** Preprocessor Stats:\n"; + llvm::errs() << NumDirectives << " directives found:\n"; + llvm::errs() << " " << NumDefined << " #define.\n"; + llvm::errs() << " " << NumUndefined << " #undef.\n"; + llvm::errs() << " #include/#include_next/#import:\n"; + llvm::errs() << " " << NumEnteredSourceFiles << " source files entered.\n"; + llvm::errs() << " " << MaxIncludeStackDepth << " max include stack depth\n"; + llvm::errs() << " " << NumIf << " #if/#ifndef/#ifdef.\n"; + llvm::errs() << " " << NumElse << " #else/#elif.\n"; + llvm::errs() << " " << NumEndif << " #endif.\n"; + llvm::errs() << " " << NumPragma << " #pragma.\n"; + llvm::errs() << NumSkipped << " #if/#ifndef#ifdef regions skipped\n"; + + llvm::errs() << NumMacroExpanded << "/" << NumFnMacroExpanded << "/" << NumBuiltinMacroExpanded << " obj/fn/builtin macros expanded, " << NumFastMacroExpanded << " on the fast path.\n"; - llvm::cerr << (NumFastTokenPaste+NumTokenPaste) + llvm::errs() << (NumFastTokenPaste+NumTokenPaste) << " token paste (##) operations performed, " << NumFastTokenPaste << " on the fast path.\n"; }