Эх сурвалжийг харах

[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
Bruno Ricci 7 жил өмнө
parent
commit
426d8cc286

+ 3 - 1
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)