|
14 | 14 | #define LLVM_EXECUTIONENGINE_ORC_SYMBOLSTRINGPOOL_H
|
15 | 15 |
|
16 | 16 | #include "llvm/ADT/DenseMap.h"
|
| 17 | +#include "llvm/ADT/Hashing.h" |
17 | 18 | #include "llvm/ADT/StringMap.h"
|
18 | 19 | #include "llvm/Support/Compiler.h"
|
19 | 20 | #include <atomic>
|
@@ -71,6 +72,7 @@ class SymbolStringPool {
|
71 | 72 | /// from nullptr to enable comparison with these values.
|
72 | 73 | class SymbolStringPtrBase {
|
73 | 74 | friend class SymbolStringPool;
|
| 75 | + friend class SymbolStringPoolEntryUnsafe; |
74 | 76 | friend struct DenseMapInfo<SymbolStringPtr>;
|
75 | 77 | friend struct DenseMapInfo<NonOwningSymbolStringPtr>;
|
76 | 78 |
|
@@ -204,7 +206,7 @@ class SymbolStringPoolEntryUnsafe {
|
204 | 206 | SymbolStringPoolEntryUnsafe(PoolEntry *E) : E(E) {}
|
205 | 207 |
|
206 | 208 | /// Create an unsafe pool entry ref without changing the ref-count.
|
207 |
| - static SymbolStringPoolEntryUnsafe from(const SymbolStringPtr &S) { |
| 209 | + static SymbolStringPoolEntryUnsafe from(const SymbolStringPtrBase &S) { |
208 | 210 | return S.S;
|
209 | 211 | }
|
210 | 212 |
|
@@ -318,6 +320,10 @@ SymbolStringPool::getRefCount(const SymbolStringPtrBase &S) const {
|
318 | 320 | LLVM_ABI raw_ostream &operator<<(raw_ostream &OS,
|
319 | 321 | const SymbolStringPtrBase &Sym);
|
320 | 322 |
|
| 323 | +inline hash_code hash_value(const orc::SymbolStringPtrBase &S) { |
| 324 | + return hash_value(orc::SymbolStringPoolEntryUnsafe::from(S).rawPtr()); |
| 325 | +} |
| 326 | + |
321 | 327 | } // end namespace orc
|
322 | 328 |
|
323 | 329 | template <>
|
|
0 commit comments