Add SelectorTable::getTotalMemory() to allow clients to query how much memory is used by selectors.

llvm-svn: 129728
This commit is contained in:
Ted Kremenek 2011-04-18 22:47:04 +00:00
parent 28af26d878
commit 1c2239e9b1
2 changed files with 7 additions and 0 deletions

View 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.

View 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)