Delete the CollectorNamePool if it should become empty.

llvm-svn: 44775
This commit is contained in:
Gordon Henriksen 2007-12-10 03:35:18 +00:00
parent dc5cafb74e
commit 4b904b9627
2 changed files with 8 additions and 0 deletions

View File

@ -70,6 +70,10 @@ namespace llvm {
/// reference-counted pointer to it. No additional memory is allocated if
/// the string already exists in the pool.
inline PooledStringPtr intern(const char *Str);
/// empty - Checks whether the pool is empty. Returns true if so.
///
inline bool empty() const { return InternTable.empty(); }
};
/// PooledStringPtr - A pointer to an interned string. Use operator bool to

View File

@ -414,6 +414,10 @@ void Function::clearCollector() {
if (CollectorNames->empty()) {
delete CollectorNames;
CollectorNames = 0;
if (CollectorNamePool->empty()) {
delete CollectorNamePool;
CollectorNamePool = 0;
}
}
}
}