summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CIndex.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-07-26 23:46:06 +0000
committerTed Kremenek <kremenek@apple.com>2011-07-26 23:46:06 +0000
commit120992ad81034687bc9fe76f6a76b60d6c4539b0 (patch)
tree15d84eda9e825aaf61edf4424b22d76f0a22537b /clang/tools/libclang/CIndex.cpp
parent99c3638935e5c00f77e687509cb195fc1d3eca89 (diff)
downloadbcm5719-llvm-120992ad81034687bc9fe76f6a76b60d6c4539b0.tar.gz
bcm5719-llvm-120992ad81034687bc9fe76f6a76b60d6c4539b0.zip
clang_getCXTUResourceUsage: Report memory used by data structures in SourceManager.
llvm-svn: 136189
Diffstat (limited to 'clang/tools/libclang/CIndex.cpp')
-rw-r--r--clang/tools/libclang/CIndex.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 017fd0bcfad..6b073f56a95 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -5455,6 +5455,9 @@ const char *clang_getTUResourceUsageName(CXTUResourceUsageKind kind) {
case CXTUResourceUsage_PreprocessingRecord:
str = "Preprocessor: PreprocessingRecord";
break;
+ case CXTUResourceUsage_SourceManager_DataStructures:
+ str = "SourceManager: data structures and tables";
+ break;
}
return str;
}
@@ -5507,9 +5510,13 @@ CXTUResourceUsage clang_getCXTUResourceUsage(CXTranslationUnit TU) {
createCXTUResourceUsageEntry(*entries,
CXTUResourceUsage_SourceManager_Membuffer_Malloc,
(unsigned long) srcBufs.malloc_bytes);
- createCXTUResourceUsageEntry(*entries,
+ createCXTUResourceUsageEntry(*entries,
CXTUResourceUsage_SourceManager_Membuffer_MMap,
(unsigned long) srcBufs.mmap_bytes);
+ createCXTUResourceUsageEntry(*entries,
+ CXTUResourceUsage_SourceManager_DataStructures,
+ (unsigned long) astContext.getSourceManager()
+ .getDataStructureSizes());
// How much memory is being used by the ExternalASTSource?
if (ExternalASTSource *esrc = astContext.getExternalSource()) {
OpenPOWER on IntegriCloud