[llvm-commits] [PATCH] YAML I/O

Michael Spencer bigcheesegs at gmail.com
Mon Oct 1 16:51:52 PDT 2012


On Mon, Oct 1, 2012 at 2:11 PM, Nick Kledzik <kledzik at apple.com> wrote:
> I now happy with how YAML I/O is working using a traits based design.   Attached is the generated documentation on how to use it and the test suite which also serves as real examples.  If this top level design looks good, I'll post the implementation for review.  Thanks.
>
>
>
>
> -Nick
>
>

Looks good. I have a few concerns though.

The API doesn't seem to be composable. By this I mean that everything
has to be defined in a single translation unit. An example of where
this comes up is reading a yaml representation of archive files. An
archive can contain many different types of object files. We would
need to be able to figure out which object file type is represented
and then forward the rest of that yaml node to the proper yaml parser.

Another use case for the above is Parser that doesn't use YAML I/O for
everything, but wants to pass a Node* to YAML I/O for a specific case.

The unique types violate the non-intrusive nature of the API. I feel
it would be better to be able to explicitly state which trait to use
in ambiguous cases.

I was thinking about using ADL instead of namespace injection for
finding the traits, but I'll have to look more into it to figure out
if it's the right solution here.

- Michael Spencer




More information about the llvm-commits mailing list