diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-07-26 23:46:06 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-07-26 23:46:06 +0000 |
commit | ca7dc2b755eb81ac95121ce1a1f1aa44a4a0fe12 (patch) | |
tree | 1a1f11bc33868e0bce4f68d3f10ce925c1dd6647 /lib/Basic/SourceManager.cpp | |
parent | cd6ab8cc43ee0171d90bf6a0b94b19e12fb831c5 (diff) |
clang_getCXTUResourceUsage: Report memory used by data structures in SourceManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136189 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/SourceManager.cpp')
-rw-r--r-- | lib/Basic/SourceManager.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index f2903e985d..68c58f7081 100644 --- a/lib/Basic/SourceManager.cpp +++ b/lib/Basic/SourceManager.cpp @@ -1598,3 +1598,11 @@ SourceManager::MemoryBufferSizes SourceManager::getMemoryBufferSizes() const { return MemoryBufferSizes(malloc_bytes, mmap_bytes); } +size_t SourceManager::getDataStructureSizes() const { + return MemBufferInfos.capacity() + + LocalSLocEntryTable.capacity() + + LoadedSLocEntryTable.capacity() + + SLocEntryLoaded.capacity() + + FileInfos.getMemorySize() + + OverriddenFiles.getMemorySize(); +} |