[llvm] [MsgPack] Use JSON schema boolean resolution rules (PR #170561)

Scott Linder via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 11 07:48:20 PST 2025


slinder1 wrote:

Thank you for the review!

FWIW I did take a closer look at what I would do to address the issue more fundamentally, and it may not be too invasive. For (my or others) future reference I think the cleanest approach would be to:

* Add an enum for supported `Schema` kinds, see https://yaml.org/spec/1.2.2/#chapter-10-recommended-schemas
  * It seems like the formalized "Schema" concept was added in YAML 1.2, but that we could get backwards compat via a default schema which just matches what LLVM currently implements.
* Add a `Schema` member to `yaml::Stream`. I didn't carefully read the spec to determine if this is the right place, but intuitively it seems like switching schemas while parsing a stream would not be useful. There isn't an in-band means to "select" the schema, so how anything other than a stream-global setting would be driven isn't clear to me.
* Implement tag resolution in `Node` based on the active `Schema`.
* The last bit I didn't think through too hard is how to handle this in the `input`/`output` methods of traits. If the signature needs to be updated to pass the `Schema` it would be a breaking change. We could permit either signature and `assert` the backwards-compat schema is used for any traits which weren't updated to give a transition period?

https://github.com/llvm/llvm-project/pull/170561


More information about the llvm-commits mailing list