aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-04-28 04:53:38 +0000
committerTed Kremenek <kremenek@apple.com>2011-04-28 04:53:38 +0000
commitba29bd25515fbd99e98ba0fedb9d93617b27609e (patch)
tree8cd565dfcb7ec193f26ce6294f3b2ed216d4a1e2 /lib/AST/ASTContext.cpp
parenta97d24f2ca50f318f62a6cf2a621e7842dd63b4a (diff)
Enhance clang_getCXTUResourceUsage() to report the amount of memory used by ASTContext's side tables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130383 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index c571c559bc..13c40f7ca1 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -6139,3 +6139,19 @@ MangleContext *ASTContext::createMangleContext() {
}
CXXABI::~CXXABI() {}
+
+size_t ASTContext::getSideTableAllocatedMemory() const {
+ size_t bytes = 0;
+ bytes += ASTRecordLayouts.getMemorySize();
+ bytes += ObjCLayouts.getMemorySize();
+ bytes += KeyFunctions.getMemorySize();
+ bytes += ObjCImpls.getMemorySize();
+ bytes += BlockVarCopyInits.getMemorySize();
+ bytes += DeclAttrs.getMemorySize();
+ bytes += InstantiatedFromStaticDataMember.getMemorySize();
+ bytes += InstantiatedFromUsingDecl.getMemorySize();
+ bytes += InstantiatedFromUsingShadowDecl.getMemorySize();
+ bytes += InstantiatedFromUnnamedFieldDecl.getMemorySize();
+ return bytes;
+}
+