[cfe-commits] r129728 - in /cfe/trunk: include/clang/Basic/IdentifierTable.h lib/Basic/IdentifierTable.cpp
Ted Kremenek
kremenek at apple.com
Mon Apr 18 15:47:04 PDT 2011
Author: kremenek
Date: Mon Apr 18 17:47:04 2011
New Revision: 129728
URL: http://llvm.org/viewvc/llvm-project?rev=129728&view=rev
Log:
Add SelectorTable::getTotalMemory() to allow clients to query how much memory is used by selectors.
Modified:
cfe/trunk/include/clang/Basic/IdentifierTable.h
cfe/trunk/lib/Basic/IdentifierTable.cpp
Modified: cfe/trunk/include/clang/Basic/IdentifierTable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/IdentifierTable.h?rev=129728&r1=129727&r2=129728&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/IdentifierTable.h (original)
+++ cfe/trunk/include/clang/Basic/IdentifierTable.h Mon Apr 18 17:47:04 2011
@@ -624,6 +624,9 @@
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.
Modified: cfe/trunk/lib/Basic/IdentifierTable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/IdentifierTable.cpp?rev=129728&r1=129727&r2=129728&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/IdentifierTable.cpp (original)
+++ cfe/trunk/lib/Basic/IdentifierTable.cpp Mon Apr 18 17:47:04 2011
@@ -433,6 +433,10 @@
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)
More information about the cfe-commits
mailing list