summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/Support/StringPool.h4
-rw-r--r--llvm/lib/VMCore/Function.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/StringPool.h b/llvm/include/llvm/Support/StringPool.h
index 7ac2b147c34..46087e4d1fe 100644
--- a/llvm/include/llvm/Support/StringPool.h
+++ b/llvm/include/llvm/Support/StringPool.h
@@ -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
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp
index 18effea5091..856385bb008 100644
--- a/llvm/lib/VMCore/Function.cpp
+++ b/llvm/lib/VMCore/Function.cpp
@@ -414,6 +414,10 @@ void Function::clearCollector() {
if (CollectorNames->empty()) {
delete CollectorNames;
CollectorNames = 0;
+ if (CollectorNamePool->empty()) {
+ delete CollectorNamePool;
+ CollectorNamePool = 0;
+ }
}
}
}
OpenPOWER on IntegriCloud