Object: Don't double-escape empty hexdata

We would emit a pair of double quotes inside a pair of single quotes.
Just use a pair of single quotes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204312 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer 2014-03-20 06:28:52 +00:00
parent 9320b807aa
commit 8bd2799a2d
2 changed files with 2 additions and 4 deletions

View File

@ -51,10 +51,8 @@ void BinaryRef::writeAsBinary(raw_ostream &OS) const {
}
void BinaryRef::writeAsHex(raw_ostream &OS) const {
if (binary_size() == 0) {
OS << "\"\"";
if (binary_size() == 0)
return;
}
if (DataIsHexString) {
OS.write((const char *)Data.data(), Data.size());
return;

View File

@ -34,5 +34,5 @@ TEST(ObjectYAML, BinaryRef) {
llvm::raw_svector_ostream OS(Buf);
yaml::Output YOut(OS);
YOut << BH;
EXPECT_NE(OS.str().find("\"\""), StringRef::npos);
EXPECT_NE(OS.str().find("''"), StringRef::npos);
}