[llvm] e9aee4f - Revert "[YAML] Make `std::array` available (#116059)"
NAKAMURA Takumi via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 13 18:39:17 PST 2024
Author: NAKAMURA Takumi
Date: 2024-11-14T11:38:51+09:00
New Revision: e9aee4fd80874f80556456f64c303ffb957bd614
URL: https://github.com/llvm/llvm-project/commit/e9aee4fd80874f80556456f64c303ffb957bd614
DIFF: https://github.com/llvm/llvm-project/commit/e9aee4fd80874f80556456f64c303ffb957bd614.diff
LOG: Revert "[YAML] Make `std::array` available (#116059)"
Compilation failed on gcc hosts.
This reverts commit 941f704f0892317701fd263603a729e0ef86dda6.
(llvmorg-20-init-12117-g941f704f0892)
Added:
Modified:
llvm/include/llvm/Support/YAMLTraits.h
llvm/unittests/Support/YAMLIOTest.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Support/YAMLTraits.h b/llvm/include/llvm/Support/YAMLTraits.h
index 510f76a66cee5b..403584e52fed3b 100644
--- a/llvm/include/llvm/Support/YAMLTraits.h
+++ b/llvm/include/llvm/Support/YAMLTraits.h
@@ -2006,11 +2006,6 @@ struct SequenceTraits<
std::enable_if_t<CheckIsBool<SequenceElementTraits<T>::flow>::value>>
: 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>>
diff --git a/llvm/unittests/Support/YAMLIOTest.cpp b/llvm/unittests/Support/YAMLIOTest.cpp
index a7d1b338719f3b..2d76b1509840f1 100644
--- a/llvm/unittests/Support/YAMLIOTest.cpp
+++ b/llvm/unittests/Support/YAMLIOTest.cpp
@@ -3366,15 +3366,6 @@ struct FixedArray {
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 @@ template <> struct MappingTraits<FixedArray> {
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 @@ TYPED_TEST(YAMLIO, FixedSizeArray) {
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 @@ TYPED_TEST(YAMLIO, FixedSizeArrayMismatch) {
}
{
- TypeParam faval;
+ FixedArray faval;
Input yin("---\nValues: [ 1, 2, 3, 4, 5 ]\n...\n");
yin >> faval;
More information about the llvm-commits
mailing list