mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-11 23:19:21 +00:00
Merge DenseMapKeyInfo & DenseMapValueInfo into DenseMapInfo
Add a new DenseMapInfo::isEqual method to allow clients to redefine the equality predicate used when probing the hash table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42042 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -35,7 +35,7 @@ class GlobalValue;
|
||||
class MachineBasicBlock;
|
||||
class MachineConstantPoolValue;
|
||||
class SDNode;
|
||||
template <typename T> struct DenseMapKeyInfo;
|
||||
template <typename T> struct DenseMapInfo;
|
||||
template <typename T> struct simplify_type;
|
||||
template <typename T> struct ilist_traits;
|
||||
template<typename NodeTy, typename Traits> class iplist;
|
||||
@@ -773,13 +773,16 @@ public:
|
||||
};
|
||||
|
||||
|
||||
template<> struct DenseMapKeyInfo<SDOperand> {
|
||||
template<> struct DenseMapInfo<SDOperand> {
|
||||
static inline SDOperand getEmptyKey() { return SDOperand((SDNode*)-1, -1U); }
|
||||
static inline SDOperand getTombstoneKey() { return SDOperand((SDNode*)-1, 0);}
|
||||
static unsigned getHashValue(const SDOperand &Val) {
|
||||
return (unsigned)((uintptr_t)Val.Val >> 4) ^
|
||||
(unsigned)((uintptr_t)Val.Val >> 9) + Val.ResNo;
|
||||
}
|
||||
static bool isEqual(const SDOperand &LHS, const SDOperand &RHS) {
|
||||
return LHS == RHS;
|
||||
}
|
||||
static bool isPod() { return true; }
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user