Author: gordon Date: Sun Dec 9 21:35:18 2007 New Revision: 44775 URL: http://llvm.org/viewvc/llvm-project?rev=44775&view=rev Log: Delete the CollectorNamePool if it should become empty.
Modified: llvm/trunk/include/llvm/Support/StringPool.h llvm/trunk/lib/VMCore/Function.cpp Modified: llvm/trunk/include/llvm/Support/StringPool.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/StringPool.h?rev=44775&r1=44774&r2=44775&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/StringPool.h (original) +++ llvm/trunk/include/llvm/Support/StringPool.h Sun Dec 9 21:35:18 2007 @@ -70,6 +70,10 @@ /// 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 Modified: llvm/trunk/lib/VMCore/Function.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=44775&r1=44774&r2=44775&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Function.cpp (original) +++ llvm/trunk/lib/VMCore/Function.cpp Sun Dec 9 21:35:18 2007 @@ -414,6 +414,10 @@ if (CollectorNames->empty()) { delete CollectorNames; CollectorNames = 0; + if (CollectorNamePool->empty()) { + delete CollectorNamePool; + CollectorNamePool = 0; + } } } } _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits