aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-07-26 23:46:11 +0000
committerTed Kremenek <kremenek@apple.com>2011-07-26 23:46:11 +0000
commitd1194fbbf65374bfa3578eb40a547e4f97b497d1 (patch)
tree4cda11f8b12443946593b1728ce21c63938b1234 /lib/Lex/HeaderSearch.cpp
parentca7dc2b755eb81ac95121ce1a1f1aa44a4a0fe12 (diff)
clang_getCXTUResourceUsage: report memory used by HeaderSearch.
This required converting the StringMaps to use a BumpPtrAllocator. I measured the compile time and saw no observable regression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136190 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/HeaderSearch.cpp')
-rw-r--r--lib/Lex/HeaderSearch.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp
index e2fd02983c..789c93f231 100644
--- a/lib/Lex/HeaderSearch.cpp
+++ b/lib/Lex/HeaderSearch.cpp
@@ -542,4 +542,10 @@ bool HeaderSearch::ShouldEnterIncludeFile(const FileEntry *File, bool isImport){
return true;
}
-
+size_t HeaderSearch::getTotalMemory() const {
+ return SearchDirs.capacity()
+ + FileInfo.capacity()
+ + HeaderMaps.capacity()
+ + LookupFileCache.getAllocator().getTotalMemory()
+ + FrameworkMap.getAllocator().getTotalMemory();
+}