[llvm] ed66b81 - Revert "[YAML IO] Check that mapping doesn't contain duplicating keys"
Anton Sidorenko via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 9 04:09:43 PST 2023
Author: Anton Sidorenko
Date: 2023-02-09T15:09:07+03:00
New Revision: ed66b81f7a8085a8ff3da4175a1fff1f78924dc1
URL: https://github.com/llvm/llvm-project/commit/ed66b81f7a8085a8ff3da4175a1fff1f78924dc1
DIFF: https://github.com/llvm/llvm-project/commit/ed66b81f7a8085a8ff3da4175a1fff1f78924dc1.diff
LOG: Revert "[YAML IO] Check that mapping doesn't contain duplicating keys"
LLDB failures: https://lab.llvm.org/buildbot/#/builders/17/builds/33865
This reverts commit 4c228ee6d40a7cff256f1a680561b6c0155ad704.
Added:
Modified:
llvm/lib/Support/YAMLTraits.cpp
llvm/unittests/Support/YAMLIOTest.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp
index 0273059e7c27f..4eb0b3afd5630 100644
--- a/llvm/lib/Support/YAMLTraits.cpp
+++ b/llvm/lib/Support/YAMLTraits.cpp
@@ -435,11 +435,6 @@ std::unique_ptr<Input::HNode> Input::createHNodes(Node *N) {
// Copy string to permanent storage
KeyStr = StringStorage.str().copy(StringAllocator);
}
- if (mapHNode->Mapping.count(KeyStr))
- // From YAML spec: "The content of a mapping node is an unordered set of
- // key/value node pairs, with the restriction that each of the keys is
- // unique."
- setError(KeyNode, Twine("duplicated mapping key '") + KeyStr + "'");
auto ValueHNode = createHNodes(Value);
if (EC)
break;
diff --git a/llvm/unittests/Support/YAMLIOTest.cpp b/llvm/unittests/Support/YAMLIOTest.cpp
index fa427f200da20..2ed79cae31edc 100644
--- a/llvm/unittests/Support/YAMLIOTest.cpp
+++ b/llvm/unittests/Support/YAMLIOTest.cpp
@@ -105,16 +105,6 @@ TEST(YAMLIO, TestMalformedMapRead) {
EXPECT_TRUE(!!yin.error());
}
-TEST(YAMLIO, TestMapDuplicatedKeysRead) {
- auto testDiagnostic = [](const llvm::SMDiagnostic &Error, void *) {
- EXPECT_EQ(Error.getMessage(), "duplicated mapping key 'foo'");
- };
- FooBar doc;
- Input yin("{foo: 3, bar: 5, foo: 4}", nullptr, testDiagnostic);
- yin >> doc;
- EXPECT_TRUE(!!yin.error());
-}
-
//
// Test the reading of a yaml sequence of mappings
//
More information about the llvm-commits
mailing list