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.
llvm-svn: 136190
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index e2fd029..789c93f 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -542,4 +542,10 @@
return true;
}
-
+size_t HeaderSearch::getTotalMemory() const {
+ return SearchDirs.capacity()
+ + FileInfo.capacity()
+ + HeaderMaps.capacity()
+ + LookupFileCache.getAllocator().getTotalMemory()
+ + FrameworkMap.getAllocator().getTotalMemory();
+}