From: Bruno Ricci Date: Mon, 6 Aug 2018 15:17:32 +0000 (+0000) Subject: [AST] Add individual size info for Types in -print-stats X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=426d8cc2866d50e0b710d962fa98d4571fc53fb1;p=clang [AST] Add individual size info for Types in -print-stats This mirrors what is done for Decls and Stmts in the -print-stats output, ie instead of printing "57426 LValueReference types" we print "57426 LValueReference types, 40 each (2297040 bytes)". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339024 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index ad635d7c8b..8f7424208f 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -885,7 +885,9 @@ void ASTContext::PrintStats() const { #define TYPE(Name, Parent) \ if (counts[Idx]) \ llvm::errs() << " " << counts[Idx] << " " << #Name \ - << " types\n"; \ + << " types, " << sizeof(Name##Type) << " each " \ + << "(" << counts[Idx] * sizeof(Name##Type) \ + << " bytes)\n"; \ TotalBytes += counts[Idx] * sizeof(Name##Type); \ ++Idx; #define ABSTRACT_TYPE(Name, Parent)