[ORC] Use inline friend definitions for SymbolStringPtr operators.

llvm-svn: 360917
This commit is contained in:
Lang Hames 2019-05-16 17:20:17 +00:00
parent 3fdd4b74a6
commit d18f58166c
1 changed files with 15 additions and 15 deletions

View File

@ -50,9 +50,6 @@ private:
class SymbolStringPtr {
friend class SymbolStringPool;
friend struct DenseMapInfo<SymbolStringPtr>;
friend bool operator==(const SymbolStringPtr &LHS,
const SymbolStringPtr &RHS);
friend bool operator<(const SymbolStringPtr &LHS, const SymbolStringPtr &RHS);
static SymbolStringPool::PoolMapEntry Tombstone;
@ -92,6 +89,21 @@ public:
StringRef operator*() const { return S->first(); }
friend bool operator==(const SymbolStringPtr &LHS,
const SymbolStringPtr &RHS) {
return LHS.S == RHS.S;
}
friend bool operator!=(const SymbolStringPtr &LHS,
const SymbolStringPtr &RHS) {
return !(LHS == RHS);
}
friend bool operator<(const SymbolStringPtr &LHS,
const SymbolStringPtr &RHS) {
return LHS.S < RHS.S;
}
private:
SymbolStringPtr(SymbolStringPool::PoolMapEntry *S)
@ -103,18 +115,6 @@ private:
SymbolStringPool::PoolMapEntry *S = nullptr;
};
inline bool operator==(const SymbolStringPtr &LHS, const SymbolStringPtr &RHS) {
return LHS.S == RHS.S;
}
inline bool operator!=(const SymbolStringPtr &LHS, const SymbolStringPtr &RHS) {
return !(LHS == RHS);
}
inline bool operator<(const SymbolStringPtr &LHS, const SymbolStringPtr &RHS) {
return LHS.S < RHS.S;
}
inline SymbolStringPool::~SymbolStringPool() {
#ifndef NDEBUG
clearDeadEntries();