Skip to content
Merged
Show file tree
Hide file tree
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
20 changes: 9 additions & 11 deletions llvm/include/llvm/Support/YAMLTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -668,17 +668,15 @@ inline QuotingType needsQuotes(StringRef S, bool ForcePreserveAsString = true) {

template <typename T, typename Context>
struct missingTraits
: public std::integral_constant<bool,
!has_ScalarEnumerationTraits<T>::value &&
!has_ScalarBitSetTraits<T>::value &&
!has_ScalarTraits<T>::value &&
!has_BlockScalarTraits<T>::value &&
!has_TaggedScalarTraits<T>::value &&
!has_MappingTraits<T, Context>::value &&
!has_SequenceTraits<T>::value &&
!has_CustomMappingTraits<T>::value &&
!has_DocumentListTraits<T>::value &&
!has_PolymorphicTraits<T>::value> {};
: public std::bool_constant<
!has_ScalarEnumerationTraits<T>::value &&
!has_ScalarBitSetTraits<T>::value && !has_ScalarTraits<T>::value &&
!has_BlockScalarTraits<T>::value &&
!has_TaggedScalarTraits<T>::value &&
!has_MappingTraits<T, Context>::value &&
!has_SequenceTraits<T>::value && !has_CustomMappingTraits<T>::value &&
!has_DocumentListTraits<T>::value &&
!has_PolymorphicTraits<T>::value> {};

template <typename T, typename Context>
struct validatedMappingTraits
Expand Down
5 changes: 2 additions & 3 deletions llvm/lib/IR/Metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,8 +1007,7 @@ MDNode *MDNode::uniquify() {
#define HANDLE_MDNODE_LEAF_UNIQUABLE(CLASS) \
case CLASS##Kind: { \
CLASS *SubclassThis = cast<CLASS>(this); \
std::integral_constant<bool, HasCachedHash<CLASS>::value> \
ShouldRecalculateHash; \
std::bool_constant<HasCachedHash<CLASS>::value> ShouldRecalculateHash; \
dispatchRecalculateHash(SubclassThis, ShouldRecalculateHash); \
return uniquifyImpl(SubclassThis, getContext().pImpl->CLASS##s); \
}
Expand Down Expand Up @@ -1065,7 +1064,7 @@ void MDNode::storeDistinctInContext() {
llvm_unreachable("Invalid subclass of MDNode");
#define HANDLE_MDNODE_LEAF(CLASS) \
case CLASS##Kind: { \
std::integral_constant<bool, HasCachedHash<CLASS>::value> ShouldResetHash; \
std::bool_constant<HasCachedHash<CLASS>::value> ShouldResetHash; \
dispatchResetHash(cast<CLASS>(this), ShouldResetHash); \
break; \
}
Expand Down
5 changes: 2 additions & 3 deletions llvm/unittests/ADT/StringRefTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1124,14 +1124,13 @@ TEST(StringRefTest, StringLiteral) {
constexpr StringRef StringRefs[] = {"Foo", "Bar"};
EXPECT_EQ(StringRef("Foo"), StringRefs[0]);
EXPECT_EQ(3u, (std::integral_constant<size_t, StringRefs[0].size()>::value));
EXPECT_EQ(false,
(std::integral_constant<bool, StringRefs[0].empty()>::value));
EXPECT_EQ(false, (std::bool_constant<StringRefs[0].empty()>::value));
EXPECT_EQ(StringRef("Bar"), StringRefs[1]);

constexpr StringLiteral Strings[] = {"Foo", "Bar"};
EXPECT_EQ(StringRef("Foo"), Strings[0]);
EXPECT_EQ(3u, (std::integral_constant<size_t, Strings[0].size()>::value));
EXPECT_EQ(false, (std::integral_constant<bool, Strings[0].empty()>::value));
EXPECT_EQ(false, (std::bool_constant<Strings[0].empty()>::value));
EXPECT_EQ(StringRef("Bar"), Strings[1]);
}

Expand Down
Loading