Don't emit an output dash for an empty sequence.
Take emitting a vector of strings for example:
std::vector<std::string> Strings = {"foo", "bar"}; LLVM_YAML_IS_SEQUENCE_VECTOR(std::string) yout << Strings;
This emits the following YAML document.
--- - foo - bar ...
However, when the vector is empty, the result is valid YAML, but is now a sequence with one element consisting of an empty list.
--- - [] ...
If we were to try to read this into a vector of strings again, it would fail.
YAML:2:4: error: not a mapping - []
The problem is the output dash before the empty list. The correct output would be:
--- [] ...
This patch fixes that. I'm not too familiar with the YAML I/O implementation beyond the traits themselves, so I'm open to suggestions if you know a better way to fix this.