diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -102,24 +102,21 @@ getStmtInfoTableEntry(Stmt::NullStmtClass); unsigned sum = 0; + unsigned total_bytes = 0; llvm::errs() << "\n*** Stmt/Expr Stats:\n"; for (int i = 0; i != Stmt::lastStmtConstant+1; i++) { if (StmtClassInfo[i].Name == nullptr) continue; sum += StmtClassInfo[i].Counter; - } - llvm::errs() << " " << sum << " stmts/exprs total.\n"; - sum = 0; - for (int i = 0; i != Stmt::lastStmtConstant+1; i++) { - if (StmtClassInfo[i].Name == nullptr) continue; if (StmtClassInfo[i].Counter == 0) continue; 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; + total_bytes += StmtClassInfo[i].Counter*StmtClassInfo[i].Size; } - - llvm::errs() << "Total bytes = " << sum << "\n"; + + llvm::errs() << " " << sum << " stmts/exprs total.\n"; + llvm::errs() << "Total bytes = " << total_bytes << "\n"; } void Stmt::addStmtClass(StmtClass s) {