Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions llvm/lib/IR/Metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -986,15 +986,10 @@ static T *uniquifyImpl(T *N, DenseSet<T *, InfoT> &Store) {
}

template <class NodeTy> struct MDNode::HasCachedHash {
using Yes = char[1];
using No = char[2];
template <class U, U Val> struct SFINAE {};

template <class U>
static Yes &check(SFINAE<void (U::*)(unsigned), &U::setHash> *);
template <class U> static No &check(...);
using check = decltype(static_cast<void (U::*)(unsigned)>(&U::setHash));

static const bool value = sizeof(check<NodeTy>(nullptr)) == sizeof(Yes);
static constexpr bool value = is_detected<check, NodeTy>::value;
};

MDNode *MDNode::uniquify() {
Expand Down