[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)".

llvm-svn: 339024
This commit is contained in:
Bruno Ricci 2018-08-06 15:17:32 +00:00
parent 56b31d8d75
commit 58e0322545
1 changed files with 3 additions and 1 deletions

View File

@ -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)