Revert "[YAML] Make `std::array` available (#116059)"
Compilation failed on gcc hosts.
This reverts commit 941f704f0892317701fd263603a729e0ef86dda6.
(llvmorg-20-init-12117-g941f704f0892)
diff --git a/llvm/include/llvm/Support/YAMLTraits.h b/llvm/include/llvm/Support/YAMLTraits.h
index 510f76a..403584e 100644
--- a/llvm/include/llvm/Support/YAMLTraits.h
+++ b/llvm/include/llvm/Support/YAMLTraits.h
@@ -2007,11 +2007,6 @@
: SequenceTraitsImpl<std::vector<T>, SequenceElementTraits<T>::flow> {};
template <typename T, unsigned N>
struct SequenceTraits<
- std::array<T, N>,
- std::enable_if_t<CheckIsBool<SequenceElementTraits<T>::flow>::value>>
- : SequenceTraitsImpl<std::array<T, N>, SequenceElementTraits<T>::flow> {};
-template <typename T, unsigned N>
-struct SequenceTraits<
SmallVector<T, N>,
std::enable_if_t<CheckIsBool<SequenceElementTraits<T>::flow>::value>>
: SequenceTraitsImpl<SmallVector<T, N>, SequenceElementTraits<T>::flow> {};
diff --git a/llvm/unittests/Support/YAMLIOTest.cpp b/llvm/unittests/Support/YAMLIOTest.cpp
index a7d1b33..2d76b15 100644
--- a/llvm/unittests/Support/YAMLIOTest.cpp
+++ b/llvm/unittests/Support/YAMLIOTest.cpp
@@ -3366,15 +3366,6 @@
int values[4];
};
-struct StdArray {
- StdArray() {
- // Initialize to int max as a sentinel value.
- for (auto &v : values)
- v = std::numeric_limits<int>::max();
- }
- std::array<int, 4> values;
-};
-
namespace llvm {
namespace yaml {
template <> struct MappingTraits<FixedArray> {
@@ -3383,21 +3374,11 @@
io.mapRequired("Values", array);
}
};
-template <> struct MappingTraits<StdArray> {
- static void mapping(IO &io, StdArray &st) {
- io.mapRequired("Values", st.values);
- }
-};
} // namespace yaml
} // namespace llvm
-using TestTypes = ::testing::Types<FixedArray, StdArray>;
-
-template <typename T> class YAMLIO : public testing::Test {};
-TYPED_TEST_SUITE(YAMLIO, TestTypes, );
-
-TYPED_TEST(YAMLIO, FixedSizeArray) {
- TypeParam faval;
+TEST(YAMLIO, FixedSizeArray) {
+ FixedArray faval;
Input yin("---\nValues: [ 1, 2, 3, 4 ]\n...\n");
yin >> faval;
@@ -3419,9 +3400,9 @@
ASSERT_EQ(serialized, expected);
}
-TYPED_TEST(YAMLIO, FixedSizeArrayMismatch) {
+TEST(YAMLIO, FixedSizeArrayMismatch) {
{
- TypeParam faval;
+ FixedArray faval;
Input yin("---\nValues: [ 1, 2, 3 ]\n...\n");
yin >> faval;
@@ -3434,7 +3415,7 @@
}
{
- TypeParam faval;
+ FixedArray faval;
Input yin("---\nValues: [ 1, 2, 3, 4, 5 ]\n...\n");
yin >> faval;