[all-commits] [llvm/llvm-project] a95717: [YAML] Support serializing MutableArrayRef

Chris B via All-commits all-commits at lists.llvm.org
Tue Jan 3 10:29:34 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a95717ef71975dca4583944b3b8380284f346129
      https://github.com/llvm/llvm-project/commit/a95717ef71975dca4583944b3b8380284f346129
  Author: Chris Bieneman <chris.bieneman at me.com>
  Date:   2023-01-03 (Tue, 03 Jan 2023)

  Changed paths:
    M llvm/include/llvm/Support/YAMLTraits.h
    M llvm/unittests/Support/YAMLIOTest.cpp

  Log Message:
  -----------
  [YAML] Support serializing MutableArrayRef

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.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D140427




More information about the All-commits mailing list