Update clang to r339409.
Change-Id: I800772d2d838223be1f6b40d490c4591b937fca2
diff --git a/linux-x64/clang/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h b/linux-x64/clang/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
index da40d1c..4c45cfd 100644
--- a/linux-x64/clang/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
+++ b/linux-x64/clang/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
@@ -23,17 +23,20 @@
class SymbolStringPtr;
-/// @brief String pool for symbol names used by the JIT.
+/// String pool for symbol names used by the JIT.
class SymbolStringPool {
friend class SymbolStringPtr;
public:
- /// @brief Create a symbol string pointer from the given string.
+ /// Destroy a SymbolStringPool.
+ ~SymbolStringPool();
+
+ /// Create a symbol string pointer from the given string.
SymbolStringPtr intern(StringRef S);
- /// @brief Remove from the pool any entries that are no longer referenced.
+ /// Remove from the pool any entries that are no longer referenced.
void clearDeadEntries();
- /// @brief Returns true if the pool is empty.
+ /// Returns true if the pool is empty.
bool empty() const;
private:
using RefCountType = std::atomic<size_t>;
@@ -43,7 +46,7 @@
PoolMap Pool;
};
-/// @brief Pointer to a pooled string representing a symbol name.
+/// Pointer to a pooled string representing a symbol name.
class SymbolStringPtr {
friend class SymbolStringPool;
friend bool operator==(const SymbolStringPtr &LHS,
@@ -109,6 +112,13 @@
return LHS.S < RHS.S;
}
+inline SymbolStringPool::~SymbolStringPool() {
+#ifndef NDEBUG
+ clearDeadEntries();
+ assert(Pool.empty() && "Dangling references at pool destruction time");
+#endif // NDEBUG
+}
+
inline SymbolStringPtr SymbolStringPool::intern(StringRef S) {
std::lock_guard<std::mutex> Lock(PoolMutex);
PoolMap::iterator I;