This moves the DenseMapInfo implementation for hash_code into
Hashing.h, removing the need to include Hashing.h (and thus <string>)
in DenseMapInfo.h. This follows the general convention of declaring
DenseMapInfo for types that we own in the respective header. The
remaining implementations in DenseMapInfo.h are all for types we
do not own.
Differential Revision: https://reviews.llvm.org/
D111451
#ifndef LLVM_ADT_DENSEMAPINFO_H
#define LLVM_ADT_DENSEMAPINFO_H
-#include "llvm/ADT/Hashing.h"
#include <cassert>
#include <cstddef>
#include <cstdint>
}
};
-template <> struct DenseMapInfo<hash_code> {
- static inline hash_code getEmptyKey() { return hash_code(-1); }
- static inline hash_code getTombstoneKey() { return hash_code(-2); }
- static unsigned getHashValue(hash_code val) { return val; }
- static bool isEqual(hash_code LHS, hash_code RHS) { return LHS == RHS; }
-};
-
} // end namespace llvm
#endif // LLVM_ADT_DENSEMAPINFO_H
#include <utility>
namespace llvm {
+template <typename T> struct DenseMapInfo;
/// An opaque object representing a hash code.
///
return hash_combine_range(arg.begin(), arg.end());
}
+template <> struct DenseMapInfo<hash_code> {
+ static inline hash_code getEmptyKey() { return hash_code(-1); }
+ static inline hash_code getTombstoneKey() { return hash_code(-2); }
+ static unsigned getHashValue(hash_code val) { return val; }
+ static bool isEqual(hash_code LHS, hash_code RHS) { return LHS == RHS; }
+};
+
} // namespace llvm
#endif