]> granicus.if.org Git - clang/commitdiff
Add SelectorTable::getTotalMemory() to allow clients to query how much memory is...
authorTed Kremenek <kremenek@apple.com>
Mon, 18 Apr 2011 22:47:04 +0000 (22:47 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 18 Apr 2011 22:47:04 +0000 (22:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129728 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/IdentifierTable.h
lib/Basic/IdentifierTable.cpp

index d566fbba48c326af655c9bbf6929f24143e1425b..5e5097df155e7545a6e3cba23a527f5b81536003 100644 (file)
@@ -624,6 +624,9 @@ public:
     return Selector(ID, 0);
   }
 
+  /// Return the total amount of memory allocated for managing selectors.
+  size_t getTotalMemory() const;
+
   /// constructSetterName - Return the setter name for the given
   /// identifier, i.e. "set" + Name where the initial character of Name
   /// has been capitalized.
index bbea23ab8da7885975d1f6674a7a3923437c8f2d..cb1f55b75773cf9e36e79539d2e6d531b62e36d0 100644 (file)
@@ -433,6 +433,10 @@ static SelectorTableImpl &getSelectorTableImpl(void *P) {
   return *static_cast<SelectorTableImpl*>(P);
 }
 
+size_t SelectorTable::getTotalMemory() const {
+  SelectorTableImpl &SelTabImpl = getSelectorTableImpl(Impl);
+  return SelTabImpl.Allocator.getTotalMemory();
+}
 
 Selector SelectorTable::getSelector(unsigned nKeys, IdentifierInfo **IIV) {
   if (nKeys < 2)