[PATCH] D140427: [YAML] Support serializing MutableArrayRef

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 12:12:48 PST 2022


beanz created this revision.
beanz added reviewers: lhames, MaskRay, labath, thegameg, Bigcheese.
Herald added a subscriber: StephenFan.
Herald added a project: All.
beanz requested review of this revision.
Herald added a project: LLVM.

While the YAML format itself doesn't support fixed-sized arrays, some
of the data structures we encode in and out of YAML (specifically in
ObjectYAML) are actually fixed-sized arrays which we end up expressing
as resizable arrays.

Enabling the YAML tooling to support reading and writing from
fixed-sized arrays using MutableArrayRef can simplify some of the error
reporting and use logic for cases where the sizes of arrays are defined
by the target format.

Note: my SFINAE-foo isn't the best, so if there is a cleaner way to
implement the traits please advise.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140427

Files:
  llvm/include/llvm/Support/YAMLTraits.h
  llvm/unittests/Support/YAMLIOTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140427.484350.patch
Type: text/x-patch
Size: 4404 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221220/7f7bc473/attachment.bin>


More information about the llvm-commits mailing list