diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-07-04 06:13:27 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-07-04 06:13:27 +0000 |
commit | bfb154ad3fcb9c03ce1b01b9a53e2cd17eedb45a (patch) | |
tree | 6fa2efa44c9825a4b9a881c4ede7dd0cbc2995dd /clang/lib/AST/Stmt.cpp | |
parent | 3c147a77313e3d256020dda06b4d63de6c0b0b57 (diff) | |
download | bcm5719-llvm-bfb154ad3fcb9c03ce1b01b9a53e2cd17eedb45a.tar.gz bcm5719-llvm-bfb154ad3fcb9c03ce1b01b9a53e2cd17eedb45a.zip |
Switch the Decl and Stmt stats printing to use llvm::errs() instead of
fprintf, and to be more consistent in formatting with the other stats
printing routines.
llvm-svn: 134374
Diffstat (limited to 'clang/lib/AST/Stmt.cpp')
-rw-r--r-- | clang/lib/AST/Stmt.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp index 380ad94ca22..39f23fba9ed 100644 --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -20,7 +20,7 @@ #include "clang/AST/ASTContext.h" #include "clang/AST/ASTDiagnostic.h" #include "clang/Basic/TargetInfo.h" -#include <cstdio> +#include "llvm/Support/raw_ostream.h" using namespace clang; static struct StmtClassNameTable { @@ -54,23 +54,24 @@ void Stmt::PrintStats() { getStmtInfoTableEntry(Stmt::NullStmtClass); unsigned sum = 0; - fprintf(stderr, "*** Stmt/Expr Stats:\n"); + llvm::errs() << "\n*** Stmt/Expr Stats:\n"; for (int i = 0; i != Stmt::lastStmtConstant+1; i++) { if (StmtClassInfo[i].Name == 0) continue; sum += StmtClassInfo[i].Counter; } - fprintf(stderr, " %d stmts/exprs total.\n", sum); + llvm::errs() << " " << sum << " stmts/exprs total.\n"; sum = 0; for (int i = 0; i != Stmt::lastStmtConstant+1; i++) { if (StmtClassInfo[i].Name == 0) continue; if (StmtClassInfo[i].Counter == 0) continue; - fprintf(stderr, " %d %s, %d each (%d bytes)\n", - StmtClassInfo[i].Counter, StmtClassInfo[i].Name, - StmtClassInfo[i].Size, - StmtClassInfo[i].Counter*StmtClassInfo[i].Size); + llvm::errs() << " " << StmtClassInfo[i].Counter << " " + << StmtClassInfo[i].Name << ", " << StmtClassInfo[i].Size + << " each (" << StmtClassInfo[i].Counter*StmtClassInfo[i].Size + << " bytes)\n"; sum += StmtClassInfo[i].Counter*StmtClassInfo[i].Size; } - fprintf(stderr, "Total bytes = %d\n", sum); + + llvm::errs() << "Total bytes = " << sum << "\n"; } void Stmt::addStmtClass(StmtClass s) { |