summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorBruno Ricci <riccibrun@gmail.com>2018-08-06 15:17:32 +0000
committerBruno Ricci <riccibrun@gmail.com>2018-08-06 15:17:32 +0000
commit58e0322545a9a536270f40883339b64d6d690618 (patch)
tree3c25b7534fcab840ad870661391fc340b8818c75 /clang
parent56b31d8d753a55209f19f2cb5bf19138e14d6548 (diff)
downloadbcm5719-llvm-58e0322545a9a536270f40883339b64d6d690618.tar.gz
bcm5719-llvm-58e0322545a9a536270f40883339b64d6d690618.zip
[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
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/AST/ASTContext.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index ad635d7c8b0..8f7424208fd 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/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)
OpenPOWER on IntegriCloud