[PATCH] D48144: [Support] Teach YAMLIO about polymorphic types

Scott Linder via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 27 13:40:04 PDT 2018


scott.linder updated this revision to Diff 162741.
scott.linder added a comment.

In cleaning up this patch I noticed our YAML parser does not handle an explicit document containing only a block-level plain scalar, e.g.:

  ---
  plain scalar
  ...

The YAMLTraits do not implement `operator<<` for the non-block scalar, presumably for this reason. As the new polymorphic trait can't determine if the value is scalar at compile-time, I added an assert to catch it dynamically for now. In the future modifying the parser to support this might be useful.


https://reviews.llvm.org/D48144

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48144.162741.patch
Type: text/x-patch
Size: 23505 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180827/eb868182/attachment.bin>


More information about the llvm-commits mailing list