14 #ifndef LLVM_EXECUTIONENGINE_ORC_SYMBOLSTRINGPOOL_H 15 #define LLVM_EXECUTIONENGINE_ORC_SYMBOLSTRINGPOOL_H 25 class SymbolStringPtr;
43 using RefCountType = std::atomic<size_t>;
46 mutable std::mutex PoolMutex;
108 return LHS.S == RHS.S;
112 return !(LHS == RHS);
116 return LHS.S < RHS.S;
122 assert(Pool.empty() &&
"Dangling references at pool destruction time");
127 std::lock_guard<std::mutex>
Lock(PoolMutex);
130 std::tie(I, Added) = Pool.try_emplace(S, 0);
135 std::lock_guard<std::mutex>
Lock(PoolMutex);
136 for (
auto I = Pool.begin(),
E = Pool.end();
I !=
E;) {
138 if (Tmp->second == 0)
144 std::lock_guard<std::mutex>
Lock(PoolMutex);
162 uintptr_t IV =
reinterpret_cast<uintptr_t
>(V.S);
168 return LHS.S == RHS.S;
174 #endif // LLVM_EXECUTIONENGINE_ORC_SYMBOLSTRINGPOOL_H void clearDeadEntries()
Remove from the pool any entries that are no longer referenced.
This class represents lattice values for constants.
String pool for symbol names used by the JIT.
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
static orc::SymbolStringPtr getEmptyKey()
const ValueTy & getValue() const
bool operator!=(const SymbolStringPtr &LHS, const SymbolStringPtr &RHS)
static unsigned getHashValue(orc::SymbolStringPtr V)
~SymbolStringPool()
Destroy a SymbolStringPool.
bool operator==(const SymbolStringPtr &LHS, const SymbolStringPtr &RHS)
Pointer to a pooled string representing a symbol name.
SymbolStringPtr intern(StringRef S)
Create a symbol string pointer from the given string.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
SymbolStringPtr(SymbolStringPtr &&Other)
friend class SymbolStringPtr
SymbolStringPtr & operator=(SymbolStringPtr &&Other)
StringRef operator*() const
static orc::SymbolStringPtr getTombstoneKey()
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
static bool isEqual(const orc::SymbolStringPtr &LHS, const orc::SymbolStringPtr &RHS)
SymbolStringPtr & operator=(const SymbolStringPtr &Other)
bool operator<(const SymbolStringPtr &LHS, const SymbolStringPtr &RHS)
SymbolStringPtr(const SymbolStringPtr &Other)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool empty() const
Returns true if the pool is empty.
StringRef - Represent a constant reference to a string, i.e.