summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-04-18 22:47:04 +0000
committerTed Kremenek <kremenek@apple.com>2011-04-18 22:47:04 +0000
commit1c2239e9b165aa1d7cfe51f8a1a8522644de0822 (patch)
tree39fe7284f38b8235b59839694db2b71e72f0b313
parent28af26d878126d92d8f124cba5143dbd7e4233cd (diff)
downloadbcm5719-llvm-1c2239e9b165aa1d7cfe51f8a1a8522644de0822.tar.gz
bcm5719-llvm-1c2239e9b165aa1d7cfe51f8a1a8522644de0822.zip
Add SelectorTable::getTotalMemory() to allow clients to query how much memory is used by selectors.
llvm-svn: 129728
-rw-r--r--clang/include/clang/Basic/IdentifierTable.h3
-rw-r--r--clang/lib/Basic/IdentifierTable.cpp4
2 files changed, 7 insertions, 0 deletions
diff --git a/clang/include/clang/Basic/IdentifierTable.h b/clang/include/clang/Basic/IdentifierTable.h
index d566fbba48c..5e5097df155 100644
--- a/clang/include/clang/Basic/IdentifierTable.h
+++ b/clang/include/clang/Basic/IdentifierTable.h
@@ -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.
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp
index bbea23ab8da..cb1f55b7577 100644
--- a/clang/lib/Basic/IdentifierTable.cpp
+++ b/clang/lib/Basic/IdentifierTable.cpp
@@ -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)
OpenPOWER on IntegriCloud