1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/unittests/TextAPI
Fangrui Song 1bbd63ef60 [YAMLIO] Remove trailing spaces when outputting maps
llvm::yaml::Output::paddedKey unconditionally outputs spaces, which
are superfluous if the value to be dumped is a sequence or map.
Change `bool NeedsNewLine` to `StringRef Padding` so that it can be
overridden to `\n` if the value is a sequence or map.

An empty map/sequence is special. It is printed as `{}` or `[]` without
a newline, while a non-empty map/sequence follows a newline. To handle
this distinction, add another variable `PaddingBeforeContainer` and does
the special handling in endMapping/endSequence.

Reviewed By: grimar, jhenderson

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

llvm-svn: 365869
2019-07-12 04:51:31 +00:00
..
CMakeLists.txt
ELFYAMLTest.cpp [YAMLIO] Remove trailing spaces when outputting maps 2019-07-12 04:51:31 +00:00
TextStubV1Tests.cpp [YAMLIO] Remove trailing spaces when outputting maps 2019-07-12 04:51:31 +00:00
TextStubV2Tests.cpp [YAMLIO] Remove trailing spaces when outputting maps 2019-07-12 04:51:31 +00:00