Make BinaryRef output correctly in case of empty data.
Previously, it would simply output nothing, but it should output an
empty string `""`.
llvm-svn: 185894
diff --git a/llvm/lib/Object/YAML.cpp b/llvm/lib/Object/YAML.cpp
index 4e7f089..5b66503 100644
--- a/llvm/lib/Object/YAML.cpp
+++ b/llvm/lib/Object/YAML.cpp
@@ -49,6 +49,10 @@
}
void BinaryRef::writeAsHex(raw_ostream &OS) const {
+ if (binary_size() == 0) {
+ OS << "\"\"";
+ return;
+ }
if (DataIsHexString) {
OS.write((const char *)Data.data(), Data.size());
return;