llvm-project/clang-tools-extra/unittests/clang-doc
Scott Linder c0830f5577 [Support] Teach YAMLIO about polymorphic types
Add support for "polymorphic" types to YAMLIO.

PolymorphicTraits can dynamically switch between other traits (Scalar, Map, or
Sequence). When inputting, the PolymorphicTraits type is told which type to
become, and when outputting the PolymorphicTraits type is asked which type it
currently is.

Also add support for TaggedScalarTraits to allow dynamically differentiating
between multiple scalar types using YAML tags.

Serialize empty maps as "{}" and empty sequences as "[]", so that types
are preserved when round-tripping PolymorphicTraits. This change has
equivalent semantics, but may break e.g. tests which compare output
verbatim.

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

llvm-svn: 346884
2018-11-14 19:39:59 +00:00
..
BitcodeTest.cpp [clang-doc] Bringing bitcode tests in line 2018-10-17 20:16:05 +00:00
CMakeLists.txt [clang-doc] Add unit tests for Markdown generation 2018-10-16 23:07:26 +00:00
ClangDocTest.cpp
ClangDocTest.h [clang-doc] Bringing bitcode tests in line 2018-10-17 20:16:05 +00:00
MDGeneratorTest.cpp [clang-doc] Add unit tests for Markdown generation 2018-10-16 23:07:26 +00:00
MergeTest.cpp [clang-doc] Add unit tests for merging 2018-10-16 23:07:04 +00:00
SerializeTest.cpp
YAMLGeneratorTest.cpp [Support] Teach YAMLIO about polymorphic types 2018-11-14 19:39:59 +00:00