This is an archive of the discontinued LLVM Phabricator instance.

[YAML IO] Check that mapping doesn't contain duplicating keys
ClosedPublic

Authored by asi-sc on Dec 21 2022, 5:24 AM.

Details

Summary

According to YAML specification keys must be unique for a mapping node:
"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".

Diff Detail

Event Timeline

asi-sc created this revision.Dec 21 2022, 5:24 AM
asi-sc requested review of this revision.Dec 21 2022, 5:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 21 2022, 5:24 AM
asi-sc updated this revision to Diff 484573.Dec 21 2022, 7:14 AM

Clang-format .cpp tests

asi-sc updated this revision to Diff 484751.Dec 22 2022, 12:20 AM

Fix BOLT AArch64/plt-gnu-ld.test

asi-sc added a comment.Jan 9 2023, 2:56 AM

Gentle ping

I think this patch needs splitting up with the updates to the tests put in their own NFC patch.

asi-sc updated this revision to Diff 489542.Jan 16 2023, 6:46 AM

Move test changes to a separate review D141848

asi-sc updated this revision to Diff 489549.Jan 16 2023, 7:05 AM

Remove tests in yaml2obj, add unittest for YAMLIO

jhenderson added inline comments.Jan 31 2023, 1:08 AM
llvm/unittests/Support/YAMLIOTest.cpp
108–110

This comment doesn't really add anything that the test name can't capture.

113–114

There's no real need to explain this here, since the comment is by the actual code logic itself.

115–117

I see that this is the pattern used above, but is there any way of testing that the error message is correct? If not, we may well want the yaml2obj test (optionally in addition to the unit test).

asi-sc updated this revision to Diff 493861.Feb 1 2023, 12:56 AM

Address review comments

asi-sc added inline comments.Feb 1 2023, 1:02 AM
llvm/unittests/Support/YAMLIOTest.cpp
108–110

I agree. It's just the structure of this test, but such comments don't give any additional information. So, I've just removed it.

115–117

Fixed.

This revision is now accepted and ready to land.Feb 1 2023, 2:20 AM
This revision was landed with ongoing or failed builds.Feb 9 2023, 3:46 AM
This revision was automatically updated to reflect the committed changes.