aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/HeaderSearch.h
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 /include/clang/Lex/HeaderSearch.h
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 'include/clang/Lex/HeaderSearch.h')
-rw-r--r--include/clang/Lex/HeaderSearch.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h
index 4d2ed2eccc..b61471d608 100644
--- a/include/clang/Lex/HeaderSearch.h
+++ b/include/clang/Lex/HeaderSearch.h
@@ -16,6 +16,7 @@
#include "clang/Lex/DirectoryLookup.h"
#include "llvm/ADT/StringMap.h"
+#include "llvm/Support/Allocator.h"
#include <vector>
namespace clang {
@@ -125,12 +126,14 @@ class HeaderSearch {
/// and this value doesn't match the current query, the cache has to be
/// ignored. The second value is the entry in SearchDirs that satisfied the
/// query.
- llvm::StringMap<std::pair<unsigned, unsigned> > LookupFileCache;
+ llvm::StringMap<std::pair<unsigned, unsigned>, llvm::BumpPtrAllocator>
+ LookupFileCache;
/// FrameworkMap - This is a collection mapping a framework or subframework
/// name like "Carbon" to the Carbon.framework directory.
- llvm::StringMap<const DirectoryEntry *> FrameworkMap;
+ llvm::StringMap<const DirectoryEntry *, llvm::BumpPtrAllocator>
+ FrameworkMap;
/// HeaderMaps - This is a mapping from FileEntry -> HeaderMap, uniquing
/// headermaps. This vector owns the headermap.
@@ -323,6 +326,9 @@ public:
search_dir_iterator system_dir_end() const { return SearchDirs.end(); }
void PrintStats();
+
+ size_t getTotalMemory() const;
+
private:
/// getFileInfo - Return the HeaderFileInfo structure for the specified