llvm/unittests/BinaryFormat
Fangrui Song d6a4ded922 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365869 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-12 04:51:31 +00:00
..
CMakeLists.txt [MsgPack] Removed MsgPackTypes 2019-03-13 18:56:33 +00:00
DwarfTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MachOTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MsgPackDocumentTest.cpp [YAMLIO] Remove trailing spaces when outputting maps 2019-07-12 04:51:31 +00:00
MsgPackReaderTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MsgPackWriterTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TestFileMagic.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00