summaryrefslogtreecommitdiffstats
path: root/clang/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
commitf5df0ce94985cd785c1709ab2df92552f0b8577e (patch)
treedbbd90874dc8d1e318e671cbca02eac78dd18884 /clang/lib/AST/ASTContext.cpp
parent290173155355c5b84f76a10f09151b642f8abce5 (diff)
downloadbcm5719-llvm-f5df0ce94985cd785c1709ab2df92552f0b8577e.tar.gz
bcm5719-llvm-f5df0ce94985cd785c1709ab2df92552f0b8577e.zip
Enhance clang_getCXTUResourceUsage() to report the amount of memory used by ASTContext's side tables.
llvm-svn: 130383
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index c571c559bc6..13c40f7ca1d 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/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;
+}
+
OpenPOWER on IntegriCloud