diff --git a/mlir/include/mlir/IR/TypeSupport.h b/mlir/include/mlir/IR/TypeSupport.h index 8112b95a4ab4..b40a806a0a3d 100644 --- a/mlir/include/mlir/IR/TypeSupport.h +++ b/mlir/include/mlir/IR/TypeSupport.h @@ -182,8 +182,7 @@ private: auto derivedKey = getKey(args...); // Create a hash of the kind and the derived key. - unsigned hashValue = llvm::hash_combine( - kind, llvm::DenseMapInfo::getHashValue(derivedKey)); + unsigned hashValue = getHash(kind, derivedKey); // Generate an equality function for the derived storage. std::function isEqual = @@ -236,28 +235,77 @@ private: static const Dialect &lookupDialectForType(MLIRContext *ctx, const void *const typeID); + //===--------------------------------------------------------------------===// + // Util + //===--------------------------------------------------------------------===// + + /// Utilities for detecting if specific traits hold for a given type 'T'. + template using void_t = void; + template class Op, class... Args> + struct detector { + using value_t = std::false_type; + }; + template